1.
<img src="xxx" style="display: none;" id="img1">
alert($('#img1').width());

2.
<div style="display: none;">
<img src="xxx" style="display: none" id="img2">
</div>
alert($('#img2').width());

case 1 can get the width of the image, but case 2 will fail, how to
solve this problem?

Reply via email to