Answer the question
In order to leave comments, you need to log in
How to replace images in Slider JS with Lazy Load that are in the img source tag?
Hello! Please tell me, I have pictures in the form of a slider and each picture has a tech picture inside which there is a source tag and this tag contains the addresses of pictures that should be loaded at a certain screen resolution, is it possible to somehow register these paths with lazy load in slider js ?
The documentation has an option where for images with lazy load in the img tag data attributes are written with the addresses of the images src and srcset
<div class="swiper-container">
<div class="swiper-wrapper">
<!-- Lazy image with srscet-->
<div class="swiper-slide">
<img data-src="path/to/logo-small.png" data-srcset="path/logo/logo-large.png 2x" class="swiper-lazy">
<div class="swiper-lazy-preloader"></div>
</div>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question