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 237 forks source link

Images in scrolling div in bootstrap modal all load when calling .lazy() #209

Closed Bremaweb closed 5 years ago

Bremaweb commented 5 years ago

I have images in a modal in a scrolling div. When $("#lazy-container .lazy").lazy({appendScroll : $("#lazy-container")}); is called, all of the images load. I have a callback for the shown.bs.modal event that calls the above line to begin lazy loading the images in the modal and all of the images load immediately.

Bremaweb commented 5 years ago

https://jsfiddle.net/BrandonReese/3xc2we7o/17/

dkern commented 5 years ago

I think this may happen because there is no default dimension and the way how BS handles the modal. So on loading all images may fit in the current viewport. This may cause this issue here. But to me sure i woudl have to dig in the code. But currently i got not enough time for this.