How to find the number of visible list items in a jQuery mobile search movie

I applied the Android phone app using jQuery Mobile and java script.

in my application

I added a dynamic list view and used the search filter attribute (true).

Now I want to pop up an alert for each search.

In this sh'd warning, the number of visible list entries for each character is displayed .

as?

Thnaks in advance

+5
source share
2 answers

The following should give you the number of the currently visible liin listviewaid=myList

$('#myList li').size() - $('#myList li.ui-screen-hidden').size()

http://jsfiddle.net/nirmaljpatel/Vy7Vu/

+6

, , : http://jsfiddle.net/Calavoow/ddTX9/3/

css .

javascript listview id="filterlist".

$(document).on("pageshow", function() {
    $("#filterlist").prev().on("keyup",function(){
        count();
    });
});

function count(){
    var elements = $("#filterlist li:visible").length;
    alert(elements);
}
+3

All Articles