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.