jQuery Mobile lazy load list items

前端 未结 3 1015
Happy的楠姐
Happy的楠姐 2021-02-11 00:55

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?

3条回答
  •  悲哀的现实
    2021-02-11 01:44

    Simple code to load more items on reaching page bottom.

     if ($(window).scrollTop() > $('#page1').height() - 500) {
            eventsElement.append('
  • Stop
  • '); eventsElement.listview('refresh'); }

    For full example,

    see Code here.

    Using jquery-mobile-iscrollview will be better. It provides pull down and pull up events

    Git hub link

提交回复
热议问题