Menu
hello,
i wan to detect a div size, below is my code
<div id=”top” class=”top” ><img src=’
<div id=”botoom” class=”bottom” ><img src=’
<script type=”text/javascript”>
var divh = document.getElementById(‘top’).offsetHeight;
if (divh >=50)
{
alert(divh);
}
</script>
i dun know what happen, seems like i have to load twice then i get the allert.
if i clear my cache and load the this page. it wont alert me until i refresh again. seems like it cant get the size on the div in 1st time load.
Any idea?