sigil88
10/13/2016 - 10:15 PM

simple js toggle

simple js toggle

    function toggleByClass(className) {

         $("."+className).toggle();

    }
// needed this for dropdown menu to prevent god damn flicker on hover
// needs testing on click/tap support for touch devices!!!
		$dropdown = $('.dropdown-toggle, .dropdown-menu');

		$dropdown.on('click tap mouseenter',function(e) {
			$(this).parent('li').toggleClass("open").animate(400);
			console.log('toggled');
		}).mouseleave(function() {
			$(this).parent('li').removeClass("open");
			console.log('mouseleave');
		});