tags:

views:

35

answers:

2

I've been noticing quite a few websites including YouTube and http://video.yahoo.com/, amazon and Facebook are loading content above the fold and then once you scroll down the rest is loaded. I'm not sure if it's the rendering of the content that is being delayed or if its media such as images that are being fetched when you scroll down.

Does anyone know how it is being done or how I can implement something similar?

+1  A: 

http://api.jquery.com/scroll/

using this event handler, you check the scroll position, compare it to the document height http://api.jquery.com/height/ and if scroll position compared to the height indicates that the user is at the bottom, or near the bottom, use ajax to get more content.

Sorry for such a general answer, it's just that this needs experimenting, and writing the code would take a little while. Maybe someone else would do it, but I will just stick to this.

Alexander
thanks for the reponse
robinsonc494
+1  A: 

true. They use javascript ( or jquery) to load content on scroll.

Most of the time Images as they take the maximum time in a page load.

Well there are several jQuery Plugins available out there which help you to achieve the same.

One plugin example is >>>> jQuery Lazy Load inspired by YUI ImageLoader

Or google - something like this - "jquery + lazy load plugin"

hope that helps

Regards, J'Sinh

J Sinh
nice, found a wordpress plugin which builds on the lazy load jq plugin. thanks
robinsonc494