jQuery - SlideDown easing

Souza picture Souza · Jul 27, 2011 · Viewed 10.5k times · Source

i was wondering if there is any way to make a slideDown() movement to look more smooth without the use of jQuery UI, just plain jquery.

I have this function:

function optionz(){
        $("#panel").slideDown('fast', function(){
        $("#panel").slideDown('slow');});
}

Well, i know that queue: false; works for animate() and i can make the animations run unqueued but don't know how to do the same with the slideDown().

The easing would require me to set another js file to load, and i really can't afford to make this just for a easing on the animation

Hope you can help me with this one.

Thanks a lot!

Answer

Gaurav picture Gaurav · Jul 27, 2011

Actually, as of jQuery 1.4.3, you don't need to load jQuery UI to do a basic "swing" easing.

$("#panel").slideDown('slow', 'swing', function() {});

See http://api.jquery.com/slideDown/