Comments (4)
Hi @liamfiddler :)
Unfortunately, even though the syntax matches with what LazySizes have specified in their documentation, it just doesn't appear to be working the way they claim it should. That said, since this is the case, I am altogether dropping the LQIP pattern from my site, and sticking to just native lazy loading with no polyfilling. The extra JavaScript is not worth it in my scenario anymore.
Since this deviates heavily from the goal of this plugin, I believe it makes sense for me to just create a simple plugin instead. Doing only one thing - adding a loading="lazy"
attribute to all img tags, unless one exists already, and adding width and height attributes. It will be a heavily stripped down version of your plugin.
from eleventy-plugin-lazyimages.
No problem. I'll close this issue and the PR.
from eleventy-plugin-lazyimages.
I have an open PR with an (almost) working solution: #21
There's one thing I still can't figure out. I want the browser to load all images specified in the src
attributes, but lazyload higher res versions specified in data-src
or data-srcset
. This doesn't appear to work either with lazysizes, or with native lazy loading.
Lazysizes says this is possible. But it doesn't appear to be the case, even if I set preferNativeLazyLoad
to false
and ensure only LazySizes is used.
from eleventy-plugin-lazyimages.
👋 Hi @hirusi !
That isn't a use case I considered but it sounds useful. I'll look at the PR over the next few days. Thanks!
I'm not sure about the second problem - it's not something I've tested before.
Setting preferNativeLazyLoad
is the correct approach to ensure Lazysizes is always used.
If that didn't work I'd recommend you look at the markup in your built site (particularly the parts generated by this plugin) and confirm it matches the markup expected by lazysizes.
from eleventy-plugin-lazyimages.
Related Issues (20)
- Using with plugin that renames final files? HOT 7
- Different lazyloader? HOT 6
- Img tags with width and height attributes. HOT 2
- lazy image for relative path HOT 5
- GIF handling doesn't seem to be working on the latest version HOT 1
- Error: Could not find MIME for Buffer <null> HOT 4
- Eleventy build issue with posts that have setted tags HOT 4
- png base 64 image are less compressed HOT 3
- Cache not loading HOT 2
- attribute only HOT 2
- noscript output HOT 2
- Trouble installing this plugin, seems to be issue with 'sharp' HOT 1
- Segfault on build HOT 3
- documentation on LQIP HOT 3
- This plugin for background image HOT 2
- Add Support To M1 Devices HOT 10
- Error when requiring plugin. HOT 2
- Disable lazy loading for certain images HOT 2
- How do i set the plugin to not use cdn lazysize.min.js and use local /js/lazysize.min.js instead?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eleventy-plugin-lazyimages.