jQuery: Fade and slide at the same time

Chaining functions is really handy, but when it comes to animation, its a bit annoying because it'll perform them in order.

To get fade and slide at the same time, use animate().

$('#element').animate({ opacity: 'toggle', height: 'toggle' }, "slow", callback_function);

The speed and callback functions are optional.

[ Source ]

 
Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog