4

I have div that contains quite a few images. When I say quite a few, the number of images could be in their hundreds.

I have some jQuery for the div that contains my images to scroll through all the images horizontally in a carousel format.

I am quite concerned with the amount of images I that will be rendered on the page and I know it will affect the page loading times.

I would be grateful if someone could show me a way to lazy load my images based on what is shown in my div.

0

1 Answer 1

5

Check out this lazy loading jQuery plugin:

http://plugins.jquery.com/lazyload/

See this SO thread for more information:

Javascript: Lazy Load Images In Horizontal Div?

Sign up to request clarification or add additional context in comments.

4 Comments

Will lazy loading all the images this way make a considerable difference to the page loading time? The image tags will still be generated on the page as the carousel is rotating through the images.
@R100 the raw HTML shouldn't be an issue, it's loading the actual images themselves that will slow things down and that will be delay for images not visible. Quote from the plugin page: "Lazy loader delays loading of images in (long) pages. Images below the fold (far down in the page) wont be loaded before user scrolls down."
Ok I shall take a look. Thanks!
@Tom this thread is 5 years old... but I updated it :) Hope it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.