How to setup flexible box CSS through jQuery? css( display, '-moz-box') doesn't seem to work?


Tags: jquery,css

Problem :

This works:

display: box;
display: -webkit-box;
display: -moz-box;

This also works:

.attr('style','display: -moz-box')

This doesn't :-(

css( display, '-moz-box')

Demo: http://jsfiddle.net/TomasReichmann/K3nQg/

I am building a plugin that displays a window-like resizeable modal box with header that can have variable height and content, that fits inside the box and displays a scrollbar if it's content is too long.



Solution :

You were missing the quotes around display; when passing a property and a value to .css(), both must be strings:

.css('display', '-moz-box')

jsFiddle demo


    CSS Howto..

    How to write css for a color when you only know the color in the RGB format [duplicate]

    how to place the images exactly in menu position

    How to write specific CSS for mozilla, chrome and IE

    How to set a css class based on content in rails

    How to spread a div to cover available space in a parent container?

    CSS: How to blur background image within the div?

    CSS - How to get star aligned properly on this page

    How to display multi-column article from a single column article data source?

    How to add a new rule to an existing CSS class

    how to remain the style of GUI component after disabling it in javafx?

    How to set column width for DataTables

    how to display products side by side

    How to align image to top left of div

    How to change the Attribute background color in css code

    How do you modify wordpress css for posts?

    Why is Nexus 4 (using Chrome for Android) showing window size as 384x519 but screenshot shows 768x1038?

    CSS: How do I shrink a div to beyond a font's invisible padding?

    How to auto adjust margin to Auto center vertical & horizontal using jQuery and CSS margin

    How remove space on around content (css)?

    How to make a webpage mobile friendly with css media queries

    how to set image for anchor tag in mvc through css?

    How to use two JavaScript (.js) files on one website?

    How to make a line in a table with CSS

    How to align form using css [closed]

    How to achieve following graphics via css

    CSS / jQuery: How to prevent tooltip from disappearing behind border of main wrapper (working code)

    How to change tr color on mouse over when there is already implemented?

    How to Get Fixed Children to Play Nicely with their Parents

    How to place divs with background-images in order with 100% width?

    Asset Pipline, how to add image path to background: url()?