diff options
author | Brandon Aaron <brandon.aaron@gmail.com> | 2007-04-03 03:04:38 +0000 |
---|---|---|
committer | Brandon Aaron <brandon.aaron@gmail.com> | 2007-04-03 03:04:38 +0000 |
commit | 14fa1e858c91cbb354009bc68fbd893ed4ff540c (patch) | |
tree | 77a641b911bb2146f1344fc979d97ebbcb65042c /src | |
parent | 9c94ef4c411867d38f301ccbf406af21e277188c (diff) | |
download | jquery-14fa1e858c91cbb354009bc68fbd893ed4ff540c.tar.gz jquery-14fa1e858c91cbb354009bc68fbd893ed4ff540c.zip |
Small optimization to jQuery.css to save 12 bytes
Diffstat (limited to 'src')
-rw-r--r-- | src/jquery/jquery.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index ddb08a438..715fbf110 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -1373,7 +1373,7 @@ jQuery.extend({ }); jQuery.swap( e, old, function() { - if (jQuery.css(e,"display") != "none") { + if ( jQuery(e).is(':visible') ) { oHeight = e.offsetHeight; oWidth = e.offsetWidth; } else { @@ -1383,14 +1383,14 @@ jQuery.extend({ visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0" }).appendTo(e.parentNode)[0]; - var parPos = jQuery.css(e.parentNode,"position"); - if ( parPos == "" || parPos == "static" ) + var parPos = jQuery.css(e.parentNode,"position") || "static"; + if ( parPos == "static" ) e.parentNode.style.position = "relative"; oHeight = e.clientHeight; oWidth = e.clientWidth; - if ( parPos == "" || parPos == "static" ) + if ( parPos == "static" ) e.parentNode.style.position = "static"; e.parentNode.removeChild(e); |