jQuery slideToggle() documentation says :
.slideToggle( [ duration ], [ easing ], [ callback ] ) (version added: 1.4.3)
duration A string or number determining how long the animation will run.
easing A string indicating which easing function to use for the transition.
callback A function to call once the animation is complete.
As you can see, there's a parameter called [ easing ]
, its description is :
Easing
As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing
, and one that progresses at a constant pace, called linear
. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.
So you have 2 choices :
1) You use one the available easing :
$('.open-mypage').click(function () {
$('#mypage-info').slideToggle('2000', "swing / linear", function () {
// Animation complete.
});
});
2) You include jQuery UI in your page and use one of its 32 easings :
$('.open-mypage').click(function () {
$('#mypage-info').slideToggle('2000', "easeOutBounce", function () {
// Animation complete.
});
});
You can see a jsFiddle example here