SlideUp a div if any other div is slided down with jQuery

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2011-01-04T21:17:19Z Indexed on 2011/01/04 22:54 UTC
Read the original article Hit count: 233

Filed under:
|
|

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");
    });

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about slideup