On Sep 7, 2007, at 3:58 PM, Erik Beeson wrote:
Great stuff, as always. I'm looking over the source and had a couple of thoughts. It looks like you bind an event handler for each matching element, so 100 images will result in 100 event handlers firing on every scroll. That seems like it wouldn't scale as well as just have one event handler that iterates over the elements.

I made some tests and you are absolutely right. Pages with hundreds of images this might become performance issue. I already have an idea how to solve this. So keep eye on new releases :)

instead of once per element per scroll. In addition, if you knew that the images that were being lazy loaded appear on the page in the order that they appear on the DOM ( i.e., images further down the DOM are also further down the page), as is likely the case in most image gallery type settings where this plugin will be most useful, you could stop checking images once you found one that was "below the fold".

Risky assumption but is true in most of cases. Maybe some user configurable setting. Have to do some thinking...

--
Mika Tuupola
http://www.appelsiini.net/



Reply via email to