X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=0b0972e9cc1bade4b836fe58cbdeb01e63661f9c;hb=8bd7a3544dd77d92ac40e119fc6bc8a385622f25;hp=f986d28f8a054fce0aa04eac91d6d620ee4fb329;hpb=c8b7881c738f6949095029d75d847acc98b0afbc;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index f986d28..0b0972e 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -441,7 +441,7 @@ jQuery.fn = jQuery.prototype = { for ( var prop in obj ) jQuery.attr( type ? this.style : this, - prop, jQuery.prop(this, obj[prop], type, index) + prop, jQuery.prop(this, obj[prop], type, index, prop) ); }); }, @@ -1262,13 +1262,16 @@ jQuery.extend({ return obj; }, - prop: function(elem, value, type, index){ + prop: function(elem, value, type, index, prop){ // Handle executable functions if ( jQuery.isFunction( value ) ) return value.call( elem, [index] ); + + // exclude the following css properties to add px + var exclude = /z-?index|font-?weight|opacity/i; // Handle passing in a number to a CSS property - if ( value.constructor == Number && type == "curCSS" ) + if ( value.constructor == Number && type == "curCSS" && !exclude.test(prop) ) return value + "px"; return value;