Tuesday, 24 July 2012

how to check element visibility in jquery?

example of element exists and it’s not visible


<div id="test">
<div id="test_1" style="display:none">
Hello World!
</div>
</div>


jQuery code:
if ($('#test_1:visible').length > 0)
{
alert('the element is visible');
}
else
{
alert('the element is not visible');
}


No comments:

Post a Comment