Created
May 12, 2017 08:54
-
-
Save koentjuh1/0011c72fa3fccfa0eb77e93c49813125 to your computer and use it in GitHub Desktop.
Add remove class with different delay
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.mainmenu-toggle').click(function(){ | |
if($(this).hasClass('mainmenu-toggle-open')){ | |
$(this).delay(200).queue(function(reset_delay){ | |
$(this).removeClass('mainmenu-toggle-open'); | |
reset_delay(); | |
}); | |
} else { | |
$(this).delay(700).queue(function(reset_delay){ | |
$(this).addClass('mainmenu-toggle-open'); | |
reset_delay(); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment