Skip to content
Recommend our themes and earn 30% of our share of every sale you bring. Free to join.Earn by recommending our themes Become an affiliate

Hide submenu after delay with jQuery

Updated 31 Jul 2018

Source code

<script>
	$(document).ready(function(){
		$("#mainMenu li:has(ul)").on("hover", function() {
			var ul = $(this).parent().find("ul");
			if ($(ul).is(":visible") === true) {
				$(ul).delay(700).hide(0);
			}
			else {
				$(ul).show(0);
			}
		});
	});
</script>

More code answers

Comments

Log in to leave a comment.