HuyPV
Saturday, December 18, 2010
Problem:
<div id="ads_item1">
<img src="/huypv/advertise/2010-12-18-kenh14.vn.gif" />
</div>
jQuery:
$(document).ready(function(){
var menuHeight = $('ads_item1').innerHeight();
alert(menuHeight);
}
Solution:
$(window).load(function(){
var menuHeight = $('ads_item1').innerHeight();
alert(menuHeight);
}
Explain:
$(window).load => loaded image => caculate image height
Title:
Chrome get height return 0
Description:
Problem: <div id="ads_item1"> <img src="/huypv/advertise/2010-12-18-kenh14.vn.gif" /> </div> jQue...
...
Rating:
4