I'm using Owl Carousel 2 in a project and it's working great.
I want to lazyload the images in each item. Thankfully, Owl Carousel 2 has a built in option for that. However, there is no option to lazyload the images in the next one or two items (which are not yet in the viewport) preemptively.
Has anyone elso e across this issue or are there any solutions to be offered?
For example, in this demo, four slides are in view. But I would like images in slide 5 and 6 to be loaded pre-emptively. And when you scroll through the carousel, whichever slides are the next two to be shown but not yet visible should also start loading before they bee visible.
I'm using Owl Carousel 2 in a project and it's working great.
I want to lazyload the images in each item. Thankfully, Owl Carousel 2 has a built in option for that. However, there is no option to lazyload the images in the next one or two items (which are not yet in the viewport) preemptively.
Has anyone elso e across this issue or are there any solutions to be offered?
For example, in this demo, four slides are in view. But I would like images in slide 5 and 6 to be loaded pre-emptively. And when you scroll through the carousel, whichever slides are the next two to be shown but not yet visible should also start loading before they bee visible.
Share asked May 3, 2015 at 19:03 VinVin 2,1655 gold badges29 silver badges35 bronze badges1 Answer
Reset to default 3You can try to add lazySizes. lazySizes is a third party lazyloader, which detects near the view images automatically and therefore can be used with many sliders without configuration.
In case you want to force a preload you can also add a the class
lazypreload
.
Here are two examples:
- lazySizes with flexslider
- lazySizes with Flickity
Be aware, that you likely need to specify the image dimensions.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744861668a4597739.html
评论列表(0条)