JqueryUI: Effects - Toggle Class

Syntax

.toggleClass( className [, switch ] [, duration ] [, easing ] [, complete ] )
ParameterTypeDescription
classNameStringRepresents the CSS class name, or space-delimited list of class names, to be added, removed, or toggled.
switchBooleanForces the toggleClass() method to add the class if true, or to remove the class if false.
durationNumber or StringOptionally 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.
easingStringA string indicating which easing function to use for the transition.
completeFuction()This is a callback method called for each element when the effect is complete for this element.

OR

.toggleClass( className [, switch ] [, options ] )
ParameterTypeDescription
classNameStringRepresents the CSS class name, or space-delimited list of class names, to be added, removed, or toggled.
switchBooleanForces the toggleClass() method to add the class if true, or to remove the class if false.
optionsNumber or StringAll 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.

Leave a Reply

Your email address will not be published. Required fields are marked *