Syntax
.toggleClass( className [, switch ] [, duration ] [, easing ] [, complete ] )
| Parameter | Type | Description |
|---|---|---|
| className | String | Represents the CSS class name, or space-delimited list of class names, to be added, removed, or toggled. |
| switch | Boolean | Forces the toggleClass() method to add the class if true, or to remove the class if false. |
| duration | Number or String | Optionally provides one of slow, normal, fast, or the duration of the effect in milliseconds. If omitted, the animate() method determines the default. Its default value is 400. |
| easing | String | A string indicating which easing function to use for the transition. |
| complete | Fuction() | This is a callback method called for each element when the effect is complete for this element. |
OR
.toggleClass( className [, switch ] [, options ] )
| Parameter | Type | Description |
|---|---|---|
| className | String | Represents the CSS class name, or space-delimited list of class names, to be added, removed, or toggled. |
| switch | Boolean | Forces the toggleClass() method to add the class if true, or to remove the class if false. |
| options | Number or String | All animation settings. All properties are optional. Possible values are: duration − A string or number determining how long the animation will run.. Its default value is 400. easing − A string indicating which easing function to use for the transition. Its default value is swing. complete − This is a callback method called for each element when the effect is complete for this element. children − This is a Boolean and represents whether the animation should additionally be applied to all descendants of the matched elements. queue − This is of type String/Boolean indicating whether to place the animation in the effects queue. |