Hide submenu after delay with jQuery


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>

Buy us coffee

Reviews and Comments