mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Change the behavior of how :visible and :hidden work. :hidden is when an element is display none, a parent element is display none, or the element has a width of 0. :visible is when the element is not display none and all of its ancesotrs are not display none and its width is larger than 0. Fixes jQuery bugs #1349, #3265, and #3895.
This commit is contained in:
@@ -937,15 +937,11 @@ jQuery.expr = Sizzle.selectors;
|
||||
jQuery.expr[":"] = jQuery.expr.filters;
|
||||
|
||||
Sizzle.selectors.filters.hidden = function(elem){
|
||||
return "hidden" === elem.type ||
|
||||
jQuery.css(elem, "display") === "none" ||
|
||||
jQuery.css(elem, "visibility") === "hidden";
|
||||
return elem.offsetWidth === 0;
|
||||
};
|
||||
|
||||
Sizzle.selectors.filters.visible = function(elem){
|
||||
return "hidden" !== elem.type &&
|
||||
jQuery.css(elem, "display") !== "none" &&
|
||||
jQuery.css(elem, "visibility") !== "hidden";
|
||||
return elem.offsetWidth > 0;
|
||||
};
|
||||
|
||||
Sizzle.selectors.filters.animated = function(elem){
|
||||
|
||||
Reference in New Issue
Block a user