Answer the question
In order to leave comments, you need to log in
How to optimize a slider with 50 photos?
There is a slider almost at the end of the page, it has 50 photos, a slider on the slick slider, Google gives 99 points. but writes that the potential savings in download time is 273 seconds. I want to load all the content of the slider when it enters the user's view. lazy load is enabled in the slick slider itself. What are the options to implement this?
Answer the question
In order to leave comments, you need to log in
You can use IntersectionObserver .
element.isIntersecting
это будет загрузка всех стилей/скриптов слайдера и его инициализация.1. catch the scroll and initialize the slider after the block with it is visible to the user
if (window.innerHeight + document.documentElement.scrollTop ===
document.documentElement.offsetHeight) {
sliderInit();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question