2011-02-15 52 views
2

任何想法如何在JQueryMobile中實現加載更多選項。在我的應用程序中,我需要提取大量數據,並希望加載前20名,並通過單擊Listview最後一行上的「加載更多」數據選項來加載更多數據。JQueryMobile Loadmore選項

回答

4

這應該工作:

$('#loadmore-link').click(function() { 
    // remove the "load more" link 
    $(this).remove(); 

    // get more LI elements (probably with a $.get()) 
    $('ul').append('<li>More list items</li>'); 

    // update the list view 
    $('ul').listview('refresh'); 
});