You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there! Love lazysizes and its working perfectly for me on Desktop. I have applied data-bgset on section elements and lazysizes definitely works in deferring the load until scrolled down in the viewport. Unfortunately, on mobile, I am not able to get the bg image to switch to a different asset. I tried the following as an attribute on my section but its not fetching the mobile asset and swapping out.
I followed the jellyfish example here --> http:https://afarkas.github.io/lazysizes/#examples but that seems more geared towards IMG sources versus background sources. Any guidance here would be super appreciated!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there! Love lazysizes and its working perfectly for me on Desktop. I have applied data-bgset on section elements and lazysizes definitely works in deferring the load until scrolled down in the viewport. Unfortunately, on mobile, I am not able to get the bg image to switch to a different asset. I tried the following as an attribute on my section but its not fetching the mobile asset and swapping out.
data-bgset="https://t24movie.com/wp-content/uploads/2022/04/T24_Backgrounds_04-3.jpg 3998w, https://t24movie.com/wp-content/uploads/2022/04/T24_BackgroundsMobile_05-1.jpg 802w"
I followed the jellyfish example here --> http:https://afarkas.github.io/lazysizes/#examples but that seems more geared towards IMG sources versus background sources. Any guidance here would be super appreciated!
EDIT:
I also found this demo --> http:https://jsfiddle.net/trixta/bfqqnosp/
This was found from viewing this documentation --> https://github.com/aFarkas/lazysizes/tree/gh-pages/plugins/bgset
Still can't get it to work on my site though :(
Beta Was this translation helpful? Give feedback.
All reactions