jQuery: Check Element Visibility
For a single element, it is very easy to check if an element is hidden or visible:
$(element).is(":visible");
$(element).is(":hidden");
To match all elements, use the ff:
$('element:hidden');
$('element:visible')
You can also check the CSS display property:
if ( $(selector).css('display') == 'none' ) {
// is hidden
} else {
// is visible
}
Comments
Post a Comment