简体   繁体   中英

How do you call a JavaScript (AJAX) function when the user reaches the end of a page to load new content?

On twitter (new twitter) and facebook they now have the the ability to load new tweets and posts when you hit the bottom of the page..

Is there a JavaScript / jQuery event that you can call / add to a div so when the browser hits the bottom it does some ajax call to get the new data?

Thanks

Daniel

There's a jQuery plugin for that: Infinite Scroll jQuery Plugin .

And here's the description of the pattern that it implements: The Interaction Design Pattern .

It's called "Lazy Loading"

a plugin for jquery: http://www.appelsiini.net/projects/lazyload

in fact there are many plugins: http://www.google.com/search?q=lazy+loading+jquery

googling for Lazy Loading will help you a load :) http://www.google.com/search?q=lazy+loading

它叫做Infinite Scrolling ,这里有一个jQuery插件: http//www.infinite-scroll.com/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM