Imagine wanting to adjust the display property of a div to inline-block. In CSS, you would typically do something like this:
#divid {
display:inline-block;
/* Adding support for IE6 and IE7 */
zoom:1;
*display:inline;
}
Now, what if you need to change the display property of a div to inline-block dynamically, using JavaScript or jQuery? Let's also assume you are only given the div element without any knowledge of the HTML and CSS of the page. If we ignore IE6 and IE7 concerns, it is straightforward:
$("#divid").css("display", "inline-block");
Dealing with IE6 and IE7 compatibility complicates things. Simply adding "*display" like in the following example doesn't work:
$("#divid").css("*display", "inline");
Do you have any suggestions?