mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04: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 Conflicts: src/css/hiddenVisibleSelectors.js
This commit is contained in:
@@ -8,7 +8,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 ||
|
||||
(!support.reliableHiddenOffsets() &&
|
||||
((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user