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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -