9
rated 0 times
[
14]
[
5]
/ answers: 1 / hits: 32202
/ 14 Years ago, thu, november 4, 2010, 12:00:00
I have the following line of javascritp $(#hero_image img).attr('src', src);
to change an image. The following lines then do whatever they do based on the images new width which I was calling through $(#hero_image img).width();
.
However, how do I ensure that this image has fully loaded before getting the width, otherwise I will be returned with the old width? Setting a timeout isn't reliable enough.
More From » image