Grow your CSS skills. Land your dream job.

I got 99 problems and JQuery FadeOut is one.

  • # 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:41 am

    @JoniGiuro – will you be my wife? Thanks so much for your help dude! Working perfect now, love it.

    # October 16, 2012 at 8:45 am

    ;) you’re welcome

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

You must be logged in to reply to this topic.

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