treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Jquery: more div opens in same position div with .slideDown() and .slideUp()

  • I need help, I don't understand anything about jQuery, but I want implement this code: DEMO: http://jsfiddle.net/urbanist/HVfaA/261/

    I want to do something like this (open work in the portfolio): http://www.jdetraz.com/#3

    this guy uses this, i think:

    $(".close_project").click(function () {
    {
    $("div.focus_project").slideUp("slow");
    $("#select_project a").removeClass("active");
    }
    });
    $("#project1").click(function () {
    if ($("div.current").is(":visible")) {
    $("div.current").slideUp("slow", function() {
    $("div.current").removeClass("current");
    $("#select_project a").removeClass("active");
    $("#longines").slideDown("slow", function() {
    $("#longines").addClass("current");
    $("#select_project a#app_longines").addClass("active");
    });
    });
    }
    else {
    $("#longines").slideDown("slow", function() {
    $("#longines").addClass("current");
    $("#select_project a#app_longines").addClass("active");
    });
    }
    }); 
    

    When div #one or #two, ecc.., is clicked, they open in the same div. And this it's ok. But I don't know how to assign in the right way -slideUp()- to the div that assigned -slideDown()- without it closes. I don't think that using -slideToggle()- is correct. Maybe I need to change class, but I don't know how to do this too.

    Sorry for my English, I thank you all in advance.

  • Oh and if is it possible, i want when box is open, the page go to top of the box. thanks guys for my requests.