views:

95

answers:

3

I am implementing a slide dropdown and i am using this code

$(document).ready(function(){
    $('.drop').click(function(){
        var $next = $(this).parent().next('li.drop_down');
        if($next.is(':visible')) {
            $next.slideUp();
        } else {
            $next.slideDown();
        }
    });
});

but the client claims that it is not smooth enough. He wants to expand really smooth, so is there a way to make it smoother

+1  A: 

You might want to incorporate the easing plugin for smoother animation.

Sarfraz
How would i use the easing plugin in my situation. I know i have to add the source but do i change the slideup and down to account for it
Matt
A: 

You could try the jQuery UI library. The Event() class provides a Slide effect where you can adjust speed and other presentation-related attributes

http://jqueryui.com/demos/effect/

Taylor
+1  A: 

You can incrase the animation duration by adding a number of ms inside the slideUp/slideDown()'s:

    if($next.is(':visible')) {
        $next.slideUp(2500);
    } else {
        $next.slideDown(2500);
    }

That should get all the smoothness you need.

Rodrigo