You have a DIV and want to check if it is visible
Use the is() function passing “:visible” :
if( $('#myDiv').is(':visible') ) {}
Hidden
This is the same as checking if an element is visible but uses :hidden instead and the logic is the reverse:
if( $('#myDiv').is(':hidden') ) {}
Elements will return TRUE to the Hidden check even if they are not but take up no space!
Make the IS NOT check to combat this.
if( !$('#myDiv').is(':visible') {} }
You can use the visible parameter to loop through all visible divs
$("#mydiv div:visible").each( function() {}
