Closed dimejo closed 2 years ago
👋 Hi Dimejo!
Yes, the imgSelector
config option allows you to specify a selector for targeting which images get lazy loaded.
Using the :not
pseudoselector we can ignore all IMG elements that have a class.
For example, the following will add lazy loading to all IMG elements except those with the class="ignore-lazy"
:
eleventyConfig.addPlugin(lazyImagesPlugin, {
imgSelector: 'img:not(.ignore-lazy)',
});
That's awesome, thank you so much!
Is it possible to disable lazy loading for certain images by e.g. adding a class?