jQuery in Action

144
CHAPTER 5
Sprucing up with animations and effects
Except for the manner in which the elements are revealed and hidden, these
effects act similarly to the other show/hide effects. Convince yourself of this by
displaying the jQuery Effects Lab Page and running through sets of exercises sim-
ilar to those we applied to the other effects.
Command syntax: slideUp
slideUp(speed,callback)
Causes any matched elements that aren't hidden to be removed from the display by gradu-
ally decreasing their vertical size.
Parameters
speed
(Number|String) Specifies the duration of the effect as a number of millisec-
onds or as one of the predefined strings: slow, normal, or fast. If omitted, the
default is normal.
callback
(Function) An optional function invoked when the animation completes. No
parameters are passed to this function, but the function context (this) is set
to the element that was animated.
Returns
The wrapped set.
Command syntax: slideToggle
slideToggle(speed,callback)
Performs slideDown() on any hidden wrapped elements and slideUp() on any non-hidden
wrapped elements. See the syntax description of these commands for their respective
semantics.
Parameters
speed
(Number|String) Optionally specifies the duration of the effect as a number of
milliseconds or as one of the predefined strings: slow, normal, or fast. If omit-
ted, no animation takes place.
callback
(Function) An optional function invoked when the animation completes. No
parameters are passed to this function, but the function context (this) is set
to the element that was animated.
Returns
The wrapped set.


Другие страницы

 
Cкачать книги бесплатно без регистрации в электронном виде (pdf, chm, txt).Вы можете читать книги онлайн на нашем сайте литературного портала книг.Большая подборка учебников, пособий, интересных книг.Электронные книги на английском языке скачать бесплатно без смс.