Reputation: 19347
Ok I have this code
$("#search-results-all").children(".search-result-item").length;
Now, all I want there is to select only the .search-result-item
elements that is only visible by using css attribute visibility:visible
. Now how can i make this possible?
P.S. Sorry I don't know what to type in Google so I can start searching.
UPDATE...
well it worked by doing something like this
$("#search-results-all").children(".search-result-item:visible").length;
thank you for the answers
Upvotes: 1
Views: 156
Reputation: 176956
:visible Selector
- Selects all elements that are visible.
$("#search-results-all").children(".search-result-item:visible").length;
or
$("#search-results-all").children(".search-result-item")).is(':visible');
Upvotes: 1
Reputation: 298512
Try this one:
$("#search-results-all .search-result-item").filter(function() {
return $(this).css('visibility') == 'visible';
});
Upvotes: 2
Reputation: 60594
The following?
$("#search-results-all > .search-result-item").filter(function() {
return $(this).css('visibility') == 'visible';
}).length;
Upvotes: 2