Negative rootMargin
Author: VDWWDCreated May 15, 2025Updated May 15, 2025
I'm initializing LazyLoad with a negative rootMargin of -250px so that the images are only loaded when they are somewhat in view. They are large images and I do not want to load them if the user has not scrolled down far enough,
The only problem is that images that are less than 250px from the left side of the browser window will never be loaded since they do not fall in the range, even if the user has scrolled down far enough.
Is there a way to specify rootMargin per side (top, right, bottom, left) instead of just 1 margin?
Source: tuupola/lazyload