简体   繁体   中英

Updating DOM on the fly to fit new elements

So you know how on Facebook, if you start scrolling down through your news feed, you can see the DOM actually update on the fly based on how far you have scrolled down so it knows to go and retrieve/display new elements? I'm assuming it does this because they don't want to load the insane amount of records for each user every-time they load up their main page.

Looks like they load enough to fill maybe 2 visible screens or something at first, and then as you scroll down they double that, and then it comes to a point where they won't load any more and it asks you to load more.

How would I accomplish something like this? Would this be done in Javascript?

The search-term you are looking for is " Infinite Scroll ". There's lots of ways to achieve this, including a jQuery plugin . As jQuery is built-in to ASP.NET I would recommend that.

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