dkern / jquery.lazy

A lightweight, fast, feature-rich, powerful and highly configurable delayed content, image and background lazy loading plugin for jQuery & Zepto.
http://jquery.eisbehr.de/lazy
Other
1.02k stars 236 forks source link

Disable loading if hidden #247

Closed schaeferpp closed 3 years ago

schaeferpp commented 3 years ago

For me, jquery.lazy always loaded images even if they currently are not visible. This checks if the image is visible (i.e. display != none) before calculating if the image is in the viewport. I thought you might find this helpful.

dkern commented 3 years ago

Thank you for your pr! But implementing it like this would be too strict and not configurable. I would have to think about the overall impact first. Maybe as a replace for the old and slightly bugged :visible filter of jQuery. So for now, I would close this.