Forums

Give help. Get help.

  • # October 16, 2012 at 7:44 am

    Howdy folks,

    I’m having trouble with the below;

    http://codepen.io/andyunleashed/pen/sfivk

    FadeOut basically refuses to work on closing the nav menu – not sure what I’m doing wrong or what I might have missed. Any JS hero’s in the house that can hook a brother up?

    # October 16, 2012 at 8:28 am

    This works for me.

    $(‘.nav-open a, li.close-nav’).click(function() {
    if(!$(‘nav’).hasClass(‘active’))
    {
    $(‘nav’).removeClass(‘mobile-hide’).fadeIn(400).addClass(“active”);
    }
    else
    {
    $(‘nav’).fadeOut(400,function(){
    $(‘nav’).removeClass(‘active’).addClass(“mobile-hide”);
    })
    }
    return false;
    });

    There was a typo and I added a callback to the fadeOut as written here

    [jQuery fadeOut()](http://api.jquery.com/fadeOut/ “jQuery fadeOut()”)

    # October 16, 2012 at 8:45 am

    ;) you’re welcome

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

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag