Web Development with jQuery®

(Elliott) #1

(^580) ❘ APPENDIX M ANIMATION AND EASING EFFECTS
toggle(
[duration]
[, easing]
[, function()]
)
Toggles each selected element using a preset
animation. The duration is either a time in
milliseconds or a time preset: "slow", "normal", or
"fast".
The easing can be either default easings "linear"
or "swing", or any easing documented below,
assuming you have installed the requisite additional
easings as part of jQuery UI.
The optional callback function is executed when
the animation has completed. this refers to the
element.
jQuery
toggle(showOrHide) Toggles each element using the boolean
showOrHide argument to explicitly determine if an
element should be shown or hidden.
jQuery
ANIMATION OPTIONS
OPTION DESCRIPTION TYPE
duration Any one of "slow", "normal", "fast", or the time
specifi ed in milliseconds (ms).
String,
Number
easing The name of the easing effect that you want to
use (plugin required). There are two built-in values,
"linear" and "swing".
String
queue Setting this to false makes the animation skip the
queue and begin running immediately.
Boolean
specialEasing A map of one or more CSS properties that are
already defi ned in the css (or properties) argument,
which are each mapped to the easing that should
be used to animate that particular property.
Object
step A function that is called for each animated property
of each animated element. This function provides an
opportunity to modify the Tween object.
Function
progress A function to be called after each step of the
animation, only once per animated element,
regardless of how many properties are animated.
The function provides the following
arguments: animation, progress, and
remainingMilliseconds.
Function
complete A function that is executed when the animation
completes.
Function
(continued)
http://www.it-ebooks.info

Free download pdf