Click here to Skip to main content
13,256,716 members (51,978 online)
Rate this:
Please Sign up or sign in to vote.

i am using ul inside the div tag, i want to load the list on demand,
i mean there is scroll at div tag and inside the div tag there
ul items, i don't want to show all the items, because there is huge records(approx 10,000) that degrade the performance of application if we show all the records.
How to implement the load on demand with list items. i want to implement this like a facebook, when user scroll the content start loading?

Note: First time i want to load the list from server.
Scroll is appearing in div tag not at ul tag.
Posted 14-Dec-12 0:37am
digimanus 14-Dec-12 6:01am
no reposting please
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I got understand your expectation.
ok, as per your description you want that there will be a div at the end of like 20 items ok? then after 20 items there will be a div which will contain "see more" button. When any body click the see more button, the next 20 item will show and so on. right..?

ok, first you can make a calculation that how many items you want to show first. you have to maintain a index in database that which cycle data you are fetching. then add see more button with index that which cycle you are selection. when click the see more button then sent the index to database and get the data from database.

in the same way you have to go ahed.

Rashed:: Bangladesh.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

The above answer is fairly good. You can also do that when Scrollbar reach to bottom end, just make a Ajax call to the sever to load other items.

There is no meaning of advance, you will need to load the thing automatically when user is interested to see them. You can get user interest by measuring the height of scrollbar.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.171114.1 | Last Updated 14 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100