jQuery Mobile lazy load list items

前端 未结 3 1764
遇见更好的自我
遇见更好的自我 2021-02-11 01:13

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:48

    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

提交回复
热议问题