[ACCEPTED]-How to know the status of the div in jquery?-status
Accepted answer
You can use is() and the :visible selector.
if( $('#test').is(':visible') ) { ... }
0
try
$(element).is(":visible")
Reference
Note : hidden fails on elements that have width but no height.
0
is(':visible')
is, of course, correct.
In pretty much all 4 my jQuery applications, I introduce a simple 3 plugin isVisible
.
$.fn.isVisible = function() {
return $.expr.filters.visible(this[0]);
};
This is about 50 times faster than 2 the above function (jsPerf example) for exactly the same 1 functionality.
if ($('#yourElement').isVisible()) {
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.