ApoorvSaxena / lozad.js

🔥 Highly performant, light ~1kb and configurable lazy loader in pure JS with no dependencies for responsive images, iframes and more
https://apoorv.pro/lozad.js/demo/
MIT License
7.44k stars 448 forks source link

Picture img Insertion helpful outside IE #130

Open TiKevin83 opened 6 years ago

TiKevin83 commented 6 years ago

From my experience using lozad so far I've needed to remove the isIE check when lazy loading pictures as chrome expects me to style the picture based off of a fallback img tag as opposed to styling the picture tag. Are others experiencing this / would it make sense to remove the isIE check before fallback img insertion? I made the change in my fork and also used hasAttribute in the attribute checks.

https://github.com/TiKevin83/lozad.js/commit/85044c802e39b9a7bed80004d791dfab778ef1eb

ApoorvSaxena commented 5 years ago

needs validation, also please open PR along with test cases and a codepen implementation