| 784 | | // Revert the padding and border widths to get the |
| 785 | | // correct height/width values |
| 786 | | jQuery.each([ "Top", "Bottom", "Right", "Left" ], function(){ |
| 787 | | old[ "padding" + this ] = 0; |
| 788 | | old[ "border" + this + "Width" ] = 0; |
| 789 | | }); |
| 790 | | |
| 791 | | // Swap out the padding/border values temporarily |
| 792 | | jQuery.swap( elem, old, function() { |
| 793 | | |
| 794 | | // If the element is visible, then the calculation is easy |
| 795 | | if ( jQuery( elem ).is(":visible") ) { |
| 796 | | height = elem.offsetHeight; |
| 797 | | width = elem.offsetWidth; |
| 798 | | |
| 799 | | // Otherwise, we need to flip out more values |
| 800 | | } else { |
| 801 | | elem = jQuery( elem.cloneNode(true) ) |
| 802 | | .find(":radio").removeAttr("checked").removeAttr("defaultChecked").end() |
| 803 | | .css({ |
| 804 | | visibility: "hidden", |
| 805 | | position: "absolute", |
| 806 | | display: "block", |
| 807 | | right: "0", |
| 808 | | left: "0" |
| 809 | | }).appendTo( elem.parentNode )[0]; |
| 810 | | |
| 811 | | var position = jQuery.css( elem.parentNode, "position" ) || "static"; |
| 812 | | if ( position == "static" ) |
| 813 | | elem.parentNode.style.position = "relative"; |
| 814 | | |
| | 788 | if ( jQuery(elem).is(":visible") ) { |
| | 789 | height = elem.clientHeight; |
| | 790 | width = elem.clientWidth; |
| | 791 | } else { |
| | 792 | jQuery.swap( elem, props, function() { |