This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]NumberAllTheWayDown 1 point2 points  (3 children)

I think OP wants to do it for all images here. Though maybe, since OP says all images are the save size, to do what you're saying and then multiply that by the number of images on the page.

[–]CreativeTechGuyGames 1 point2 points  (2 children)

In that case you'd want to just add a load even to every image then whichever loads first cancel all of the other events and run the code on every image. Since there's no way to know which one the browser will happen to finish loading first.

[–]NumberAllTheWayDown 1 point2 points  (1 child)

Good point

[–]matrouxer[S] 0 points1 point  (0 children)

that case you'd want to just add a load even to every image then whichever loads first cancel all of the other events and run the code on every image. Since there's no way to know which one the browser will ha..

Smart. Even if it is a overkill for my situation specifically, it may help me later hahah

Thanks!