mirror of
https://github.com/jquery/jquery.git
synced 2026-02-01 09:44:56 -05:00
- Reverts behavior from 10399dd, which we never released.
BR and inline elements are considered visible.
- The possibility of dropping .offsetWidth and .offsetHeight
was debunked by this perf:
http://jsperf.com/visible-hidden-and-getclientrects
Fixes gh-2227
Close gh-2281
14 lines
300 B
JavaScript
14 lines
300 B
JavaScript
define([
|
|
"../core",
|
|
"../selector"
|
|
], function( jQuery ) {
|
|
|
|
jQuery.expr.filters.hidden = function( elem ) {
|
|
return !jQuery.expr.filters.visible( elem );
|
|
};
|
|
jQuery.expr.filters.visible = function( elem ) {
|
|
return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
|
|
};
|
|
|
|
});
|