mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Fix for #812
This commit is contained in:
parent
5ebd5f604a
commit
8bd7a3544d
9
src/jquery/jquery.js
vendored
9
src/jquery/jquery.js
vendored
@ -441,7 +441,7 @@ jQuery.fn = jQuery.prototype = {
|
|||||||
for ( var prop in obj )
|
for ( var prop in obj )
|
||||||
jQuery.attr(
|
jQuery.attr(
|
||||||
type ? this.style : this,
|
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;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
prop: function(elem, value, type, index){
|
prop: function(elem, value, type, index, prop){
|
||||||
// Handle executable functions
|
// Handle executable functions
|
||||||
if ( jQuery.isFunction( value ) )
|
if ( jQuery.isFunction( value ) )
|
||||||
return value.call( elem, [index] );
|
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
|
// 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 + "px";
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
Loading…
Reference in New Issue
Block a user