Prevent clicking on parent nav links


/ Published in: jQuery
Save to your folder(s)

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.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.