Looking for a way to dynamically add more lists to the bottom of jQuery Mobile listview

后端 未结 3 1139
名媛妹妹
名媛妹妹 2020-12-28 10:36

I am looking for a way to add more lists to the bottom of my listview after scrolling down. For instance, I have a return of 20 items initially. I was going to use a paginat

3条回答
  •  失恋的感觉
    2020-12-28 11:01

    This is example might help out:

    http://jsfiddle.net/dhavaln/nVLZA/

    // load test data initially
    for (i=0; i < 20; i++) {
        $("#list").append($("
  • " + i + "

    z

  • ")); } $("#list").listview('refresh'); // load new data when reached at bottom $('#footer').waypoint(function(a, b) { $("#list").append($("
  • " + i+++"

    z

  • ")); $("#list").listview('refresh'); $('#footer').waypoint({ offset: '100%' }); }, { offset: '100%' });​

提交回复
热议问题