11// Create innerHeight, innerWidth, outerHeight and outerWidth methods
22jQuery . each ( [ "Height" , "Width" ] , function ( i , name ) {
33
4- var tl = name == "Height" ? "Top " : "Left " , // top or left
5- br = name == "Height" ? "Bottom " : "Right " ; // bottom or right
4+ var tl = i ? "Left " : "Top " , // top or left
5+ br = i ? "Right " : "Bottom " ; // bottom or right
66
77 // innerHeight and innerWidth
88 jQuery . fn [ "inner" + name ] = function ( ) {
@@ -16,13 +16,12 @@ jQuery.each([ "Height", "Width" ], function(i, name){
1616 return this [ "inner" + name ] ( ) +
1717 num ( this , "border" + tl + "Width" ) +
1818 num ( this , "border" + br + "Width" ) +
19- ( ! ! margin ?
19+ ( margin ?
2020 num ( this , "margin" + tl ) + num ( this , "margin" + br ) : 0 ) ;
2121 } ;
2222
2323} ) ;
2424
2525function num ( elem , prop ) {
26- elem = elem . jquery ? elem [ 0 ] : elem ;
27- return elem && parseInt ( jQuery . curCSS ( elem , prop , true ) , 10 ) || 0 ;
26+ return elem [ 0 ] && parseInt ( jQuery . curCSS ( elem [ 0 ] , prop , true ) , 10 ) || 0 ;
2827}
0 commit comments