.slideDown()
JQ Home <<
Effects <<
.slideDown()
Sliding down elements.
Description
The .slideDown()
method uses a sliding motion to show the matched set.
Syntax
Signature | Description |
---|---|
.slideDown( [duration] [, easing] [, callback] ) | Uses a sliding motion to show the matched set. |
Parameters
Parameter | Description | Type |
---|---|---|
duration | A string or number determining the time the animation will run for. default: 400
| String orNumber |
easing | Specify the speed at which the animation progresses at different points within the animation. default: swing
| String |
callback | A function that fires once the animation is complete.
|
Function |
Return
A jQuery
object.
.slideDown( [duration] [, easing] [, callback] )
Example
Effects << Top
Uses a sliding motion to show the matched set optionally providing a duration, and/or an easing and/or a callback function.
- When used in its basic form with no parameters or incorrect parameters the
.slideDown()
method defaults to sliding down the element(s) with aduration
of 400 milliseconds which is the default.
In the example below when the left button is pressed we use 'swing' easing to animate the picture as we slide it down.
When the centre button is pressed we use a callback to alert when the image has been slid down.
When the right button is pressed we use a duration, easing and a callback to alert when the image is slid down.
$(function(){
$('#btn16').on('click', function() {
$('#pie12').slideDown('swing');
});
$('#btn17').on('click', function() {
$('#pie13').slideDown('slow', function() {
alert('Animation finished.');
});
});
$('#btn18').on('click', function() {
$('#pie14').slideDown('slow', 'swing', function() {
alert('Animation complete.');
});
});
});
Related Tutorials
jQuery Intermediate Tutorials - Lesson 7 - Fading & Sliding Effects