Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Slide Up upon clicking on another item?

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #43445
    wragen22
    Member

    Hi There,
    Currently when a use clicks on a h1 the slide down happens. If you click on another, first item clicked will stay open. I am trying to get the first item to slide up upon clicking on another so there is only one slide down function open at a time.

    Also having another issue where the there is supposed to be a fade-in-out upon hover over which is not working.. not a big deal though.

    [ jamilopitts.com/kirby](http://www.jamilopitts.com/kriby “fonts”)

    here is what i’m using now.

    $(‘article p, article .font-btns’).hide();
    $(‘article h1’).addClass(‘pointer’).click(function() {
    var $article = $(this).parent(),
    $siblings = $(this).siblings();
    if ($article.hasClass(‘expanded’)) {
    $siblings.slideToggle(‘slow’).promise().done(function() {
    $article.removeClass(‘expanded’);
    });
    } else {
    $article.addClass(‘expanded’);
    $siblings.slideToggle(‘slow’);
    }
    });

    #128563
    wragen22
    Member

    anybody?

    #128589
    wragen22
    Member

    Thanks @srig99. Upon hovering on and off the h1’s there should be a but nothing happens.

    @include transition (background 0.2s ease-in-out)

    can you explain the portion of the code in which cause the originally opened to close?

    #128813
    wragen22
    Member

    any idea @srig99 ?

    #128945
    rthor
    Member

    It’s now just a matter of styling: http://codepen.io/rthor/details/bcHCk

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.