Return to Snippet

Revision: 34708
at October 27, 2010 10:18 by kristarella


Initial Code
<script type="text/javascript">
jQuery(function() {
	jQuery(".menu li:has('ul') > a").each(function() {
		jQuery(this).addClass("nolink").click(function() {
			return false;
		});
		
	});
});
</script>

Initial URL


Initial Description
This javascripts stops you from clicking on a nav link when there's a submenu below it, and it adds a class of "noclick" to the link, which you can use with CSS to change the cursor and background colour etc.
.menu a.noclick:hover {cursor:default;}

You could change the anchor tag to a span, but that requires more CSS to match the other links.

Initial Title
Prevent clicking on parent nav links

Initial Tags
jquery

Initial Language
jQuery