8 Deleting edit and adding note for future users.
source | link

In order to make a Nice Menu, I created a menu like this:

My Menu
   - First link
   - Second link
   - Third link

The menu works perfectly fine, but I also had to fill in a link for the 'My Menu' (I've set it to the frontpage). However, I'd like the parent link to be linked to nowhere. How can I do that?

This is the relevant code for the menu's parent:

<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>

EditNote: After reading this commentAt first, I tried adding

Drupal.behaviors.MYSITE = {
  attach: function(context, settings) {

    $('#nice-menu-2 ' +
    'li > ' +
    'a:not(.MYSITE-processed)').attr('href', '#')
                                   .addClass('MYSITE-processed');

  }
};

couldn't get the code from the accepted answer working, because I forgot to load my theme's scriptMYTHEME.js file, but that doesn't work. DidAfter reading this, I learned that one can do something wrong? Can I work on with this?that by adding scripts[] = MYTHEME.js to the MYTHEME.info file.

In order to make a Nice Menu, I created a menu like this:

My Menu
   - First link
   - Second link
   - Third link

The menu works perfectly fine, but I also had to fill in a link for the 'My Menu' (I've set it to the frontpage). However, I'd like the parent link to be linked to nowhere. How can I do that?

This is the relevant code for the menu's parent:

<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.MYSITE = {
  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?

In order to make a Nice Menu, I created a menu like this:

My Menu
   - First link
   - Second link
   - Third link

The menu works perfectly fine, but I also had to fill in a link for the 'My Menu' (I've set it to the frontpage). However, I'd like the parent link to be linked to nowhere. How can I do that?

This is the relevant code for the menu's parent:

<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>

Note: At first, I couldn't get the code from the accepted answer working, because I forgot to load my theme's MYTHEME.js file. After reading this, I learned that one can do that by adding scripts[] = MYTHEME.js to the MYTHEME.info file.

7 deleted 12 characters in body
source | link

In order to make a Nice Menu, I created a menu like this:

My Menu
   - First link
   - Second link
   - Third link

The menu works perfectly fine, but I also had to fill in a link for the 'My Menu' (I've set it to the frontpage). However, I'd like the parent link to be linked to nowhere. How can I do that?

This is the relevant code for the menu's parent:

<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_behaviorMYSITE = {
  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?

In order to make a Nice Menu, I created a menu like this:

My Menu
   - First link
   - Second link
   - Third link

The menu works perfectly fine, but I also had to fill in a link for the 'My Menu' (I've set it to the frontpage). However, I'd like the parent link to be linked to nowhere. How can I do that?

This is the relevant code for the menu's parent:

<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?

In order to make a Nice Menu, I created a menu like this:

My Menu
   - First link
   - Second link
   - Third link

The menu works perfectly fine, but I also had to fill in a link for the 'My Menu' (I've set it to the frontpage). However, I'd like the parent link to be linked to nowhere. How can I do that?

This is the relevant code for the menu's parent:

<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.MYSITE = {
  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?

6 deleted 3 characters in body
source | link

In order to make a Nice Menu, I created a menu like this:

My Menu
   - First link
   - Second link
   - Third link

The menu works perfectly fine, but I also had to fill in a link for the 'Menu title''My Menu' (I've set it to the frontpage). However, I'd like the parent link to be linked to nowhere. How can I do that?

This is the relevant code for the menu's parent:

<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?

In order to make a Nice Menu, I created a menu like this:

My Menu
   - First link
   - Second link
   - Third link

The menu works perfectly fine, but I also had to fill in a link for the 'Menu title' (I've set it to the frontpage). However, I'd like the parent link to be linked to nowhere. How can I do that?

This is the relevant code for the menu's parent:

<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?

In order to make a Nice Menu, I created a menu like this:

My Menu
   - First link
   - Second link
   - Third link

The menu works perfectly fine, but I also had to fill in a link for the 'My Menu' (I've set it to the frontpage). However, I'd like the parent link to be linked to nowhere. How can I do that?

This is the relevant code for the menu's parent:

<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?

5 edited body
source | link
4 deleted 8 characters in body
source | link
3 added 19 characters in body
source | link
2 Adding code and edit.
source | link
1
source | link