I am loading images via jQuery’s ajax function, and I have to measure the dimensions of the image, to then realign the divs and such once they have loaded, the problem is that if the image isn’t fully loaded then it can’t get the dimensions of the image, but the event has already fired, so the image is aligned horribly wrong. I have tried a couple of different jQuery plugins, and they partially work, but not entirely, none of them seem to fully wait for the image to load, the width is successfully retrieved, and it is all aligned horizontally fine, however vertically it doesn’t.
Share
I am not sure what you are trying to achieve but if aligning the images vertically is what you want, have you checked the jQuery Masonry plugin ? It can align the divs/images dynamically and has a
imagesLoadedmethod which works pretty well in my experience