opening a div closing the others
- by Mael
I'm trying to make a sliding panel using .animate function because I want it to slide left/right (jQuery allow slideUp and slideDown, but no other directions).
I made the animation like this :
jQuery('#slide1-button').toggle(
function(){jQuery('#slide1').animate({right: 700},600);},
function(){jQuery('#slide1').animate({right: -700},600);}
);
jQuery('#slide2-button').toggle(
function(){jQuery('#slide2').animate({right: 700},600);},
function(){jQuery('#slide2').animate({right: -700},600);}
);
jQuery('#slide3-button').toggle(
function(){jQuery('#slide3').animate({right: 700},600);},
function(){jQuery('#slide3').animate({right: -700},600);}
);
Now I would like the opened panel to hide when I open an other one.