Fixed bug with jQuery: height computation for hidden elements

This commit is contained in:
Klaus Hartl 2006-09-01 16:04:50 +00:00
parent 905a0ae351
commit 744c0609d4

View file

@ -1168,12 +1168,19 @@ jQuery.extend({
oWidth = e.offsetWidth; oWidth = e.offsetWidth;
} else { } else {
e = jQuery(e.cloneNode(true)).css({ e = jQuery(e.cloneNode(true)).css({
visibility: "hidden", position: "absolute", display: "block" visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0"
}).appendTo(e.parentNode)[0]; }).appendTo(e.parentNode)[0];
var parPos = jQuery.css(e.parentNode,"position");
if ( parPos == "" || parPos == "static" )
e.parentNode.style.position = "relative";
oHeight = e.clientHeight; oHeight = e.clientHeight;
oWidth = e.clientWidth; oWidth = e.clientWidth;
if ( parPos == "" || parPos == "static" )
e.parentNode.style.position = "static";
e.parentNode.removeChild(e); e.parentNode.removeChild(e);
} }
}); });