Make setting .css(name, undefined) a no-op. Fixes #4388.
This commit is contained in:
parent
879799fe95
commit
558d96b42a
2 changed files with 14 additions and 1 deletions
|
@ -20,6 +20,11 @@ var ralpha = /alpha\([^)]*\)/,
|
|||
};
|
||||
|
||||
jQuery.fn.css = function( name, value ) {
|
||||
// Setting 'undefined' is a no-op
|
||||
if ( arguments.length === 2 && value === undefined ) {
|
||||
return this;
|
||||
}
|
||||
|
||||
return jQuery.access( this, name, value, true, function( elem, name, value ) {
|
||||
return value !== undefined ?
|
||||
jQuery.style( elem, name, value ) :
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue