RapidWeaver Snippets Button

Deactivate Parent Menu Anchor Link

If you would like to deactivate the parent menu in your RapidWeaver theme and only leave the child menu items available for anchor tags you can easily achieve this with jQuery. The following code will also leave the anchor in place so that the CSS is not lost.

Place the code into the following section: Page Info » Header » JavaScript

1
2
3
$(window).load( function() {
     $('#nav > ul:first-child > li > a').removeAttr('href');
});

All this is saying is to remove the href attribute from you anchor tags, so you’ll keep the CSS attached to the tags for styling, but it remove the link out.

If you would still like users to see a hand when they cover over this link then you will need to add the styling into the section: Page Info » Header » CSS

1
#nav li {cursor:pointer}

Note that if you are using another theme you will need to rename #nav to whatever element wraps around your menu.

Please follow & like us :)
Follow by Email
Facebook
Twitter
INSTAGRAM
Google+
http://onelittledesigner.com/rapidweaver/rapidweaver-snippets/deactivate-parent-menu-anchor-link/">
RSS

Leave a Reply

Your email address will not be published. Required fields are marked *
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>