I havent try it yet, but it works with tabs plugin?
<div><span class="gmail_quote">On 9/7/07, <b class="gmail_sendername">Erik Beeson</b> <<a href="mailto:erik.beeson@gmail.com">
erik.beeson@gmail.com</a>> wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">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!
<span class="sg">
--Erik
</span><div><span class="q"><span class="gmail_quote">On 9/3/07, <b class="gmail_sendername">Mika Tuupola</b> <<a href="mailto:tuupola@appelsiini.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
tuupola@appelsiini.net</a>> wrote:</span>
</span><div><span class="e" id="q_114e00cf93d084da_4"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Little something I worked on sunday.
<a href="http://www.appelsiini.net/projects/lazyload" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.appelsiini.net/projects/lazyload</a>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.
<a href="http://www.appelsiini.net/projects/lazyload/enabled.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.appelsiini.net/projects/lazyload/enabled.html</a>--
Mika Tuupola
<a href="http://www.appelsiini.net/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.appelsiini.net/</a>
</blockquote></span></div></div>
</blockquote></div>
<br clear="all">
--
Rafael Santos Sá :: webdeveloper
<a href="http://www.rafael-santos.com">www.rafael-santos.com</a>