tags:

views:

21

answers:

2

I am using accordians. I want that if someone click on hyperlink inside the accordion , then that accordion should slide up slowly and only after that the nect accordion falls down or open

 $(".accord").live('click', function(){    

                                         $('#rr1').next().slideUp('slow');                 
                                          $('#rr3').next().slideDown('slow'); 

But i have seen that the other accordion starts opening up at the same time when the other is closing.

It it something related to asynchronous thing. I don't know });

+1  A: 

Use the callback parameter to start the second animation when the first finishes.

$(".accord").live('click', function(){    
        $('#rr1').next().slideUp('slow', function(){
                $('#rr3').next().slideDown('slow'); 
        });
});
Matthew Flaschen
Suppose i have 7 items and i want to execute in sequence one after the other , how will i do then
Mirage
A: 

The second argument to slideup is a callback function that is called when the animation is complete

http://api.jquery.com/slideUp/

Galen