Jquery animation in firefox

Posted by Ravindra Soni on Stack Overflow See other posts from Stack Overflow or by Ravindra Soni
Published on 2010-04-30T06:43:39Z Indexed on 2010/04/30 6:47 UTC
Read the original article Hit count: 375

Filed under:

i am using following code for animation using jquery. when i click on a list element, the corresponding div slides down and opacity goes to ‘1’. When i click other list element, the previos one goes up and fades, and the next one come down.

var id_prev;
 var id_new;
$("#tag ul li ").click(function(event){
    var i = $(this).index()+1;
    var id_new="#person"+i;
    if(id_new != id_prev){
        $(id_prev).animate({top:'300px',opacity:'0'},500);
        $(id_prev).delay(200).css({'z-index':'0'});
        $(id_new).delay(200).css({'z-index':'300'});
        $(id_new).delay(200).animate({top:'300px',opacity:'0'},500);
        $(id_new).delay(200).animate({top:'330px',opacity:'1'},500);
        id_prev = id_new;
    }

});

© Stack Overflow or respective owner

Related posts about animation