How to unload HTML <img> that is not visible?

elfredastrohm

New Member
These days, it is common to lazily load images as the user scrolls them into view. I need to lazily load and unload.Let's say that I have a page with so many large images that the browser gets slow. That part is not changeable. Not all images are visible at once, so I should be able to speed things up by lazily loading the images within the viewport, and lazily unloading the images that are outside of the viewport.What are some ways to do this? Raw JavaScript or a library like jQuery are both fine.
 
Back
Top