Google+

Tuesday, June 11, 2013

Testing if something is hidden with jQuery

In jQuery, it is possible to toggle the visibility of an element. You can use the functions .hide(),.show() or .toggle().
How you would test if an element has been hidden or shown using jQuery?

As, the question refers to a single element, this code might be more suitable:
$(element).is(":visible") // Checks for display:[none|block], ignores visible:[true|false]

Note:-Please comment and reply me.