I have a link to index.html on the HOME button. But when you come to the mobilemenu (small screen menu) when you click this link you only get to the sub menu not to index.html. So what i want is when clicking the HOME button (in smallscreen menu) to go to index.html and to show the sub menu. I have manage to get the link working but when i come to index.html page the sub menu don’t show. The menu uses this js script:
Change yor screen size to about 900px or less, so that the mobile menu is toggled.
First click a link that has no submenu.
Now click a link that have submenus. You will see that the links them self do not work. You only go to submenu not the actual link. You can easely see this on the page name text i added on the pages about 400px down from top.
When the mobile menu is showing, if you click a link that has a submenu (e.g. home) then you see links to “Home”, “Home Sub 1” and “Home Sub 2”. All of these links work (for me at least). What is not correct about that?
I think we’re getting our wires crossed.
In the screenshot you say “You can’t reach index.htm from the mobile menu”
You can.
Make sure the mobile view is showing (obviously)
Go to Contact us
Open the menu by clicking on the hamburger icon
Click on “Home”
You now see “Back”, “Home”, “Home Sub 1” and “Home Sub 2”.
Click on “Home”
You are now at index.html
I’m sorry. i dont know how else to explain. Refrech the page i have now removed the home link in the sub menu. I want to to go to index.html when clicking the main HOME button/link not the home link in sub menu.
Make sure the mobile view is showing (obviously)
Go to Contact us
Open the menu by clicking on the hamburger icon
Click on “Home” (You are now at index.html)
You now see “Back”, “Home Sub 1” and “Home Sub 2”.
It’s ''e.preventDefault(); in here that stops the home link going straight to index.htm.
// click interacts in mobile wersion
$('.rmm-dropdown').click(function (e) {
if($(this).parents(".rmm-menu").hasClass('rmm-mobile')){
//e.preventDefault();
e.stopPropagation();
With that line commented out the top level will take you to the home page but of course the subnavs will not be open as the new page will know nothing about them. I guess you would have to pass some data to the new page to trigger the opening of the menu but that’s too advanced for me
It seems an unnecessary step to me when you could just have the links in the submenu anyway or not have a submenu when you don’t want anyone to use it.
or not have a submenu when you don’t want anyone to use it. What do you mean?
It seems an unnecessary step to me. Yes i could have a Home link in the submenu, but i think user will be confused when they don’t come to the index.html page when clicking the Home link in the main menu.
I guess you would have to pass some data to the new page to trigger the opening of the menu. This is exactly what i need. and it is to advanced for me to
In the mobile menu you make the user click the home link and a submenu opens but it seems you don’t want them to use the sub menu but instead go to the home page and have a sub menu open on the home page instead. Therefore the submenu is redundant on all but the home page.
The problem is that on wide screen you have a hover menu which means that you can hover the menu and the sub links appear and then you have a choice of clicking the sublinks or indeed clicking the top level menu link. In mobile mode the menu only opens on click as there is no hover on mobiles so you don’t have that choice. You either go straight to the link you want or you allow the submenu to open and navigate from there.
Generally the top level menu in a dropdown would not be a link to anywhere and the destination would be via the submenus. These days you don’t need a fallback link on the top level because css can open the menus even with js off.
Therefore showing the submenus when on mobile is redundant on all but the home page if we follow your methodology
Hopefully @James_Hibbard can help with your js request now that the problem is somewhat clarified.
To me this seems very counter-intuitive!
Having the sub-menu open by default will take up valuable space on a mobile screen. On a mobile, the menu should be unobtrusive, not get in your way. And what happens if the amount of sub-menu points grows to five or six? Half of the display will be menu!
Secondly, I’m still not clear how this should work. Should this behaviour be applied to all expandable menu points (e.g. Projects or Clients)? What should happen to the menu’s “Back” button (which lets you navigate back to the full menu)?
As it is the menu works fine. I would honestly leave it like that.
Should this behaviour be applied to all expandable menu points (e.g. Projects or Clients)? What should happen to the menu’s “Back” button:
Yes this should be applied to all expandable menu points. The back button should just close the sub menu and go back to mobile full menu.
As it is the menu works fine: But if i have sub menu on home button and no home button in the sub menu how can i reach index.html from the Mobile menu? I think it look strange if i have both a Home button in the main menu and then also a Home button in the sub menu.
You want those top level menu points which themselves contain sub menu points (e.g. clients) to be clickable. So, for example when you hover over “Clients” you see a dropdown with “Ikea” and “Fastec”. You want that when a user clicks on “Ikea” or “Fastec” they are taken to the “Ikea” or “Fastec” page respectively. However, when the user clicks on “Clients”, then they should be taken to the “Clients” page. In the desktop view this is possible, in the mobile view it is not.
Yes that’s what I was assuming but as I mentioned above that will make any dropdowns in the mobile view redundant because the first click on the top level will navigate away. It’s a tricky problem and one way to solve it would be for the plus icon to open the menu only but the text to be the link rather than the whole block being the link.
Please learn how to quote other posts, as it will make your posts easier to read.
To do this, highlight the text you wish to quote and a “quote reply” button will appear. Click this and the quote will be inserted into your post, like so:
So, to your problem. The best advice I can give you is: don’t do this. You are fighting the plugin and what it is designed to do. Also, opening menus by default will take away valuable space on a mobile screen. Instead, organize your pages in a way that compliments the library.
If however, you are really insistent on proceeding with this I would do the following.
Add a resize listener that checks for the presence of an element with the class rmm-mobile. This will indicate mobile view.
Add an identifier to your page heading, so that a script can check the page we are currently on: <h1 id="page">HOME</h1>
On resize, when in mobile view, remove all sub menus, except for that of the page you are on. Save these elements somewhere (in an array, object or on a sibling node). Then trigger a click on the menu to open it.
When going from mobile view to full-screen view, retrieve the previously removed elements and re-append them.
Here is a demo of this technique, so that you can see what I mean. Copy the code to your PC and resize the window. I didn’t bother re-appending the nodes (final step), as it is my hope you won’t use this technique.
Thank you for this. I still want to try this if nothing else just to see how this will look like. I will try this later so if you could please show me the last part (appending the nodes (final step) i would be thankful.