Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery Mobile lazy load list items

How do you know that you are at the bottom of a list in jQuery Mobile, I need to lazy load in more results when the end of the list is reached?

like image 930
Manatok Avatar asked Jan 27 '26 18:01

Manatok


1 Answers

There is a working example of using scrollstart and scrollstop events here, that should get you going in the right direction: http://jsfiddle.net/shanabus/LJTJt/

Documentation page here: http://jquerymobile.com/test/docs/api/events.html

Hope this helps!

UPDATE

With help from this post, I was able to wire up a better example that does detection against the bottom of the page. If your list view is not in the bottom of the page, this will not work as well. Check the console for some position debug information.

http://jsfiddle.net/shanabus/LJTJt/1/

Here it only adds a new item when you reach the bottom of the list.

like image 67
shanabus Avatar answered Jan 30 '26 08:01

shanabus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!