I found out the hard way today that in order to set the float style for an element in javascript, you can't use:
element.style.float
because float is a reserved word, bla bla. Fine and dandy. So I look up what I need to use instead. Found the standards way:
element.style.cssFloat
But wait...It doesn't work in IE. In IE I have to use their type:
element.style.styleFloat
IE is such a POS. Anyway, thought I might save someone else from having to dig around for it.
TrackBacks[4]
Comments[8]
Posted by gthought on January 19, 2007 2:45:38 PM CST
Reply |
Permalink
Re: cssFloat and styleFloat
Well put. I just spent a couple hours digging around trying to figure out a similar problem. Many thanks for doing just what you mentioned... it helped greatly.
Comment from jeremiah on February 2, 2007 12:43:49 PM CST
Thank you. I got the info about "float" and "cssFloat" elsewhere, but yours added the much-needed IE-only info.
Comment from Anonymous on February 8, 2007 3:14:50 PM CST
Thanks for the tip. Found it in Google right away. Just knew there something screwy with IE.
Comment from Matt Thiessen on February 28, 2007 7:15:04 PM CST
...i spent several hours to hunt this property problem, even sites like http://www.w3schools.com/htmldom/dom_obj_style.asp missed this information.
Big Thanks!
Comment from Pahis on March 28, 2007 6:06:56 AM CDT
Thank you :) It helped a lot. And also thanks for Google to find this page.
Comment from dH on July 20, 2007 11:33:29 AM CDT
Wow, what a bunch of crap from MSIE.
Microsoft needs to get on that, seriously now...
I suppose in the meantime you could make separate classes in your CSS, for instance
.floatRight {
float: right;
}
.floatLeft {
float: left;
}
and use javascript to change the classes. That should work even in primitive browsers like IE.
Comment from zoogies on July 31, 2007 1:55:52 AM CDT
Thank you, you saved me!
Comment from Michelle on September 9, 2007 8:24:36 PM CDT
Thank a lot
Comment from Tomtom on October 1, 2008 5:17:57 AM CDT
TrackBack from creole restaurant erie pennsylvania on February 17, 2007 5:42:39 AM CST
TrackBack from passion flower plant on February 17, 2007 7:20:53 PM CST
TrackBack from schools in nc on February 18, 2007 10:45:57 AM CST
TrackBack from la musica della mafia on February 19, 2007 2:40:02 AM CST




