jquerymobile listview events - number of remaining items after filter applied

前端 未结 2 1519
刺人心
刺人心 2021-01-22 00:55

I\'m trying to find an easy way to check how many list items are left after a list has been filtered.

I can pick up when the list is being filtered via

$         


        
相关标签:
2条回答
  • 2021-01-22 01:39

    You can also check for the presence of class ui-screen-hidden:

    $('#theList li').length - $('#theList .ui-screen-hidden').length
    
    0 讨论(0)
  • 2021-01-22 01:56

    To count the remaining li showing, use the psudo-selector of ":visible" like this...

    $("#theList li:visible").length

    0 讨论(0)
提交回复
热议问题