Correct Menu Hamburger Animation

1

I need help in the animation of my hamburger menu, when we click on the menu the animation is executed well, but it is also activated by clicking anywhere in the document HELP!

<a href="https://gyazo.com/b9990a79cdfa722aa3feb6eea3e0228b">
<img src="https://i.gyazo.com/b9990a79cdfa722aa3feb6eea3e0228b.gif" 
     alt="https://gyazo.com/b9990a79cdfa722aa3feb6eea3e0228b" width="310"/></a>

jQuery code:

//Hamburguer Menu Animacion
  $(document).ready("#navbar").click(function() {
    $('.navbar-toggle').toggleClass('activate');
});

Corrected Code:

$(document).ready(function(){ $('.navbar-toggle').click(function(){ $(this).toggleClass('activate'); }); });

    
asked by Sebastian Moya 10.04.2018 в 06:48
source

1 answer

0

This is the animation, I just want to know how to implement it so that it activates only when the button is pressed.

    
answered by 10.04.2018 в 06:51