This problem is only in IE. And no, forgetting IE is NOT an option.
I want to get the width of an element, specifically a DIV, into a variable in JS. but for now, just to alert.
simple right?
this code should do it right?
alert(document.getElementById("'.$GLOBALS['styleprefix'].'-flyoutdiv").offsetWidth);
you would think. but no. the problem comes from the fact that when the page first loads, the div I need to measure does not exist yet. It is created by JS after the page (or while the page) is loaded. The Div is also hidden, but it does have a specific width set by the style sheet. Though the style sheet also is written after the fact.
The code above is inside a function, that gets run onmouseover.
when I do, IE returns 0, FF returns the actual width.
it has something to do with the order of execution of JS and DOM building i think. Even if i put the width actually into the style element of the DIV, i still can't get anything but 0.
so, thoughts?