Grow your CSS skills. Land your dream job.

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

  • # January 14, 2013 at 2:12 am

    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.

    # January 14, 2013 at 2:28 am

    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.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".