Check for visible items inside a div

4

How to check if there is any visible element or vice versa within a <div> ?

I can get around with jQuery and tried using el.is(':visible') but I could not because I need to check if everyone inside <div> is hidden.

    
asked by anonymous 06.07.2015 / 03:48

1 answer

3

With your friend's comment @marcelobonifazio

The author was able to use:

var divFilho = divPai.find('ul:visible').length;

if(divFilho === 0){
    divPai.hide().addClass('hidden');
}
    
06.07.2015 / 04:35