javascript - JQuery FadeIn with every 2nd click -
i'm trying create burgermenu, easy dropdown without animations.
after tried let dropdown fade in on click following script:
<script> $('span.nav-button').click(function(){ console.log("information: click!"); $(".burgermenu").fadein(500); }); </script>
because of can no longer close menu, menu tries fadein every time.
can show me way fade class on second time click menu?
use .toggle() method:
$('span.nav-button').click(function(){ $(".burgermenu").toggle(); });
just use toggle method
Comments
Post a Comment