Follow link when clicking on sub-menu #252
-
|
I am testing SmartMenus version 2 instead of 1. In large-screen mode I want to have sub-menus that open automatically when I hover over them with the mouse, and if I remove the mouse they should close automatically. I've got this working great in version 2. However, when I click on a heading for a submenu in version 2 all that is done is that the submenu is closed. This is not what I want. When I click on a submenu heading with a link I want the browser to go to the link, not just hide the submenu. I have looked though the manual and the online configurator but I have not found a way to get SM2 to follow a submenu heading link when you click on it. I did try some hacking in the JS, and managed to get it partly working, but only partly... I am not much of a JavaScript hacker I'm afraid. Anyone have any ideas how I can get SM2 to behave the way I want and follow submenu heading links when you click on them? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi, in v2 the script supports split links - i.e. menu items that have both a link part and a sub menu toggler button part - for example: <li class="sm-nav-item"><a class="sm-nav-link sm-nav-link--split" href="https://www.google.com">Google</a><button class="sm-nav-link sm-nav-link--split sm-sub-toggler"></button>
<ul class="sm-sub">
...
</ul>
</li>which would result in: Compared to a regular parent item that only acts as a sub menu toggler button on click - e.g.: <li class="sm-nav-item"><a class="sm-nav-link" href="#">Sub</a>
<ul class="sm-sub">
...
</ul>
</li>which looks like: You could still set an actual URL in the So basically the idea in v2 is to use such split items whenever you need to set an actual link to your parent items. Do you have any concerns about using such split items? |
Beta Was this translation helpful? Give feedback.


Hi, in v2 the script supports split links - i.e. menu items that have both a link part and a sub menu toggler button part - for example:
which would result in:
Compared to a regular parent item that only acts as a sub menu toggler button on click - e.g.:
which looks like:
You could still set an actual URL in the
hrefattribute of the link for regular items but th…