Start a new discussion

To start a new discussion please visit the discussions section of the GitHub home page of the project.

Discussions on GitHub

You can also search our old self-hosted forums for any useful information below but please note that posting new content here is not possible any more.

Reply To: How to make this work with no links at the top level?

Home Forums Latest release 1.1.x How to make this work with no links at the top level? Reply To: How to make this work with no links at the top level?

#8271
admin
Keymaster

Yes, the script requires <a> elements for triggering the sub menus so some modifications would be needed if you would like to use <span>‘s instead.

However, I am not sure there is any serious reason for not using <a>‘s, is there? You could even omit the href attribute if you like (not advisable) and it would still work properly with mouse/touch:

...
<li><a>About</a>
  <ul>
    ...

On the other hand, there is a serious reason for using <a>s inside parent menu items (and not omitting the href as in the above example) – without a link element your parent menu item loses its ability to gain focus and thus the sub menu becomes completely inaccessible via the keyboard (unless you specifically add a tabindex attribute to your <span>‘s but that is still not a perfect replacement for a real link).