| @@ 7165-7198 (lines=34) @@ | ||
| 7162 | } |
|
| 7163 | }, |
|
| 7164 | ||
| 7165 | css: function( elem, name, extra, styles ) { |
|
| 7166 | var num, val, hooks, |
|
| 7167 | origName = jQuery.camelCase( name ); |
|
| 7168 | ||
| 7169 | // Make sure that we're working with the right name |
|
| 7170 | name = jQuery.cssProps[ origName ] || |
|
| 7171 | ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); |
|
| 7172 | ||
| 7173 | // gets hook for the prefixed version |
|
| 7174 | // followed by the unprefixed version |
|
| 7175 | hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; |
|
| 7176 | ||
| 7177 | // If a hook was provided get the computed value from there |
|
| 7178 | if ( hooks && "get" in hooks ) { |
|
| 7179 | val = hooks.get( elem, true, extra ); |
|
| 7180 | } |
|
| 7181 | ||
| 7182 | // Otherwise, if a way to get the computed value exists, use that |
|
| 7183 | if ( val === undefined ) { |
|
| 7184 | val = curCSS( elem, name, styles ); |
|
| 7185 | } |
|
| 7186 | ||
| 7187 | //convert "normal" to computed value |
|
| 7188 | if ( val === "normal" && name in cssNormalTransform ) { |
|
| 7189 | val = cssNormalTransform[ name ]; |
|
| 7190 | } |
|
| 7191 | ||
| 7192 | // Return, converting to number if forced or a qualifier was provided and val looks numeric |
|
| 7193 | if ( extra === "" || extra ) { |
|
| 7194 | num = parseFloat( val ); |
|
| 7195 | return extra === true || isFinite( num ) ? num || 0 : val; |
|
| 7196 | } |
|
| 7197 | return val; |
|
| 7198 | } |
|
| 7199 | } ); |
|
| 7200 | ||
| 7201 | jQuery.each( [ "height", "width" ], function( i, name ) { |
|
| @@ 6177-6209 (lines=33) @@ | ||
| 6174 | } |
|
| 6175 | }, |
|
| 6176 | ||
| 6177 | css: function( elem, name, extra, styles ) { |
|
| 6178 | var val, num, hooks, |
|
| 6179 | origName = jQuery.camelCase( name ); |
|
| 6180 | ||
| 6181 | // Make sure that we're working with the right name |
|
| 6182 | name = jQuery.cssProps[ origName ] || |
|
| 6183 | ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); |
|
| 6184 | ||
| 6185 | // Try prefixed name followed by the unprefixed name |
|
| 6186 | hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; |
|
| 6187 | ||
| 6188 | // If a hook was provided get the computed value from there |
|
| 6189 | if ( hooks && "get" in hooks ) { |
|
| 6190 | val = hooks.get( elem, true, extra ); |
|
| 6191 | } |
|
| 6192 | ||
| 6193 | // Otherwise, if a way to get the computed value exists, use that |
|
| 6194 | if ( val === undefined ) { |
|
| 6195 | val = curCSS( elem, name, styles ); |
|
| 6196 | } |
|
| 6197 | ||
| 6198 | // Convert "normal" to computed value |
|
| 6199 | if ( val === "normal" && name in cssNormalTransform ) { |
|
| 6200 | val = cssNormalTransform[ name ]; |
|
| 6201 | } |
|
| 6202 | ||
| 6203 | // Make numeric if forced or a qualifier was provided and val looks numeric |
|
| 6204 | if ( extra === "" || extra ) { |
|
| 6205 | num = parseFloat( val ); |
|
| 6206 | return extra === true || isFinite( num ) ? num || 0 : val; |
|
| 6207 | } |
|
| 6208 | return val; |
|
| 6209 | } |
|
| 6210 | } ); |
|
| 6211 | ||
| 6212 | jQuery.each( [ "height", "width" ], function( i, name ) { |
|