I've tried to get the offsetWidth and offsetHeight properties like so:
<div id="somediv" class="some_class_with_dimensions"></div><script...>alert(document.getElementById('somediv').offsetWidth);</script>
Unfortunately, on IE7 offsetWidth only works if i call in on window.onload, otherwise it just returns 0. Does anyone know any other way around this problem, because i need to immediately work with "somediv" just like in开发者_StackOverflow社区 real browsers.
精彩评论