mirror of
https://github.com/jquery/jquery.git
synced 2026-02-01 00:08:17 -05:00
CSS: elements are hidden when either offsetWidth or offsetHeight is zero
- Note: this is a breaking change that has been delayed for several versions. Fixes #10406 Fixes #13132
This commit is contained in:
@@ -6,7 +6,9 @@ define([
|
||||
jQuery.expr.filters.hidden = function( elem ) {
|
||||
// Support: Opera <= 12.12
|
||||
// Opera reports offsetWidths and offsetHeights less than zero on some elements
|
||||
return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
|
||||
// Use OR instead of AND as the element is not visible if either is true
|
||||
// See tickets #10406 and #13132
|
||||
return elem.offsetWidth <= 0 || elem.offsetHeight <= 0;
|
||||
};
|
||||
jQuery.expr.filters.visible = function( elem ) {
|
||||
return !jQuery.expr.filters.hidden( elem );
|
||||
|
||||
Reference in New Issue
Block a user