Hi Mika, 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. This would also make it fairly easy to add a "keep loading the images after everything else has loaded" type feature that someone else mentioned since you could just start iterating your array of elements in window.load and maybe use setTimeout to keep the UI from bogging.
Also, with just one handler, you would only have to call $(window).height() and $(window).scrollTop() once per scroll 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". Lastly, does not removing custom attributes lead to memory leaks? I thought I recalled something about not cleaning up expandos leading to memory leakage, but I'm not sure if that applies here. Just some thoughts. Hope I don't sound too nitpicky. I think it's an awesome plugin, and I'm looking forward to putting it to use! Thanks Mika! --Erik On 9/3/07, Mika Tuupola <[EMAIL PROTECTED]> wrote: > > > Little something I worked on sunday. > > http://www.appelsiini.net/projects/lazyload > > Plugin which enables deferred loading (lazy loading) of images. In > other words, images which are below the fold (far down the page not > visible in browser) are not loaded before user scrolls down. This > plugin should be useful with long pages which have lot of photo > content. For example photoblogs. > > Demo pages is available. You might want to use Firebug or liveHTTP > headers to better see what is happening. > > http://www.appelsiini.net/projects/lazyload/enabled.html > > -- > Mika Tuupola > http://www.appelsiini.net/ > > > >