SlideUp a div if any other div is slided down with jQuery
- by John
I have made a function to slidedown different div's by clicking different links. Following is basic code. However, there's a little problem that, for example, if i click on first link, it slides down div. Now If i click on next link, it keeps the first div, and slides down the second div. However I want to do it so that, if there is any div slided down, and I click on any link, it should slide up the previous div and slide down the newer one. I will appriciate your help in this regard. Thanks.
$("a.about").click(function(){
$("#about").slideDown("slow");
});
$("a.info").click(function(){
$("#info").slideDown("slow");
});
$("a.contact").click(function(){
$("#contact").slideDown("slow");
});