diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core.js b/src/core.js index 0e02436fc..5a098bebd 100644 --- a/src/core.js +++ b/src/core.js @@ -1284,8 +1284,10 @@ jQuery.each({ jQuery.className.remove( this, classNames ); }, - toggleClass: function( classNames ) { - jQuery.className[ jQuery.className.has( this, classNames ) ? "remove" : "add" ]( this, classNames ); + toggleClass: function( classNames, state ) { + if( typeof state !== "boolean" ) + state = !jQuery.className.has( this, classNames ); + jQuery.className[ state ? "add" : "remove" ]( this, classNames ); }, remove: function( selector ) { |