I'm having a flyout menu on my Drupal 7 website (provided by the Nice Menus module) that is activated when a user hovers it. I have to give up a path for the parent by default, but I actually don't want the parent to be linked to somewhere. I tried the answer from Disable link using css, but that also disables the hovering effect.
Is there a way to remove the link from the menu's parent, but keep it's mouseover effect?
This is the relevant code:
<div id="block-nice-menus-2">
<ul id="nice-menu-2">
<li class="menu__item">
<a class="menu__link menu__link" href="/mysite/">
My Menu
</a>
</li>
</ul>
</div>
Edit: After reading this comment, I tried adding
Drupal.behaviors.my_custom_behavior = {
attach: function(context, settings) {
$('#nice-menu-2 ' +
'li > ' +
'a:not(.MYSITE-processed)').attr('href', '#')
.addClass('MYSITE-processed');
}
};
to my theme's script.js
file, but that doesn't work. Did I do something wrong? Can I work on with this?