Forums

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

Home Forums JavaScript I got 99 problems and JQuery FadeOut is one.

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #40321
    Andy Howells
    Participant

    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?

    #111970
    JoniGiuro
    Participant

    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()”)

    #111975
    JoniGiuro
    Participant

    ;) you’re welcome

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