Widgets

the possible reason may be the images are still not yet load in, therefore jQuery get empty (0) number of the images' width or height. refer to this ("Official way to ask jQuery wait for all images to load before executing something").

usually we use:
$(document).ready()
and may use $('img.resize').width() or .height() to get width or height of images with class 'resize'. but the better way is to use:
$(window).load()

FYR.

0 Comments:

Post a Comment

 
Top