Open esl51 opened 4 years ago
Tiny Slider can handle only img tags for lazy loading. Please, add support for source tag in picture tag. Note: source in picture has only srcset attribute.
img
source
picture
srcset
<picture> <source class="tns-lazy-img" data-srcset="image.webp" type="image/webp"> <img class="tns-lazy-img" data-src="image.jpg" alt="fallback"> </picture>
Maybe, replacing this line
if (!imgSelector) { imgSelector = 'img'; }
with this
if (!imgSelector) { imgSelector = 'img,picture>source'; }
helps.
There seems to be an open PR for this #352
Tiny Slider can handle only
img
tags for lazy loading. Please, add support forsource
tag inpicture
tag. Note:source
inpicture
has onlysrcset
attribute.Maybe, replacing this line
with this
helps.