Make sure that height/width getters work on hidden inputs and disconnected elements. Fixes #7225.

This commit is contained in:
jeresig 2010-10-22 00:28:33 -04:00
parent 3df41db036
commit e4a38670b1
2 changed files with 23 additions and 1 deletions

View file

@ -169,6 +169,10 @@ jQuery.each(["height", "width"], function( i, name ) {
});
}
if ( val < 0 || val === 0 && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
return elem.style[ name ] || "0px";
}
return val + "px";
}
},