question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to select how many images to preload with lazyload

See original GitHub issue

The only feature I am wishing for would be the ability to choose how many images to preload like the numImagesToPreload feature in Royal Slider (referring to royal slider documentation - options - numImagesToPreload).

A page I’m working on will have many carousels, around 10-15, with 5-10 images each. On Demand lazy loading helps, but means a delay every time the user changes the image.

Progressive lazy loading means a decent first load of the initially visible images, but a lot of bandwidth used otherwise for images that may never actually be seen.

(Otherwise I am of course so happy with slick, it’s an amazing library, many thanks)

Issue Analytics

  • State:open
  • Created 9 years ago
  • Reactions:8
  • Comments:12

github_iconTop GitHub Comments

6reactions
Djulescommented, Nov 24, 2016

There is another value for lazyLoad option in the source code, not documented though: ‘anticipated’.

It seems to do what the OP was looking for.

3reactions
klibanskycommented, Apr 12, 2015

I needed this function too but because SlickSlider doesn’t support different sources for 72dpi and retina images I had to use another plugin. I chose lazyLoadXT (https://github.com/ressio/lazy-load-xt). I implemented it using:

slickSlider.on('afterChange', function() {
    var activeSlide = $('.slick-slide.slick-active');
    activeSlide.next().find('img[data-srcset]').lazyLoadXT({
        show: true
    });
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Lazy Loading Images – The Complete Guide - ImageKit.io
You can find out which images are a candidate for lazy loading and how many bytes you can save on the initial page...
Read more >
Browser-level image lazy loading for the web - web.dev
This post covers the loading attribute and how it can be used to control the loading of images.
Read more >
Three Popular and Efficient Ways for Loading Images
Preload images only if you have no other choice because doing so risks encountering the potential drawbacks of lazy loading and requires, by ......
Read more >
Lazy loading - Web performance | MDN
Lazy loading can be applied to multiple resources and through multiple strategies. General. Code splitting JavaScript, CSS and HTML can be split ...
Read more >
Improving the Image Loading Experience
The video of the final result is based on this setting. So using LQIP, lazy load on all but the first image and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found