06
Sep
Learn how to test if something is hidden with jQuery
Q: In jQuery, if you have an element of some kind that you’re hiding and showing, using .hide(), .show() or .toggle(). How do you check if that element is currently hidden or visible on the screen?
A: If it refers a single element, this code might be more suitable:
$(element).is(“:visible”);
Or you can use the “hidden” and “visible” selectors.
$(‘element:hidden’)
http://docs.jquery.com/Selectors/hidden
$(‘element:visible’)
http://docs.jquery.com/Selectors/visible