Closed joeldbirch closed 8 years ago
As is often the case, soon after posting this I noticed that wp-lazysizes does intend to use WordPress's native srcset
attribute (changing it to data-srcset
). I probably wouldn't have bothered asking the above had I noticed. The way forward is probably to resolve issue #11 for now.
Feel free to close this if I've answered my own question. ;)
All right.
Hello,
In light of issue #11, maybe this plugin should disable WordPress's native responsive images, allowing LazySizes to work as normal? I find the native implementation can be a hit and miss affair anyway, particularly on sites built prior to its existence. Here is an example
<img>
output on a random site I built, formatted for readability:I don't think that combination of attributes and image sizes delivers particularly useful benefits, and I find this quite common. I think users of wp-lazysizes will likely benefit more from disabling this new markup and continue lazy-loading a suitable image size.
I have been using the following code from Joseph Fusco's Disable Responsive Images plugin to disable the native responsive images markup, which makes wp-lazyloading work correctly:
Do you think wp-lazysizes should add this so lazyloading continues to work as normal, without the more verbose markup?
I've been familiarising myself with this plugin's code, doing some refactoring and adding tests, so I thought I'd ask for direction here before I go much further.