Parent Menu Item Links are being removed in frontend HTML
Hello,
I have created a navigation menu on a client's new website, with flyouts, etc. Our menu works well enough (styling it was a bit more tedious that I'd have liked, but that's for another post) - Now, when the menu is shown in the frontend, the page links are being removed from parent items which have children (Parent items without children have their links)
I've scoured the forums, and even talked to support, and the support agent recommended I post in this forum. You can view the site here: https://transcard.com/
An example of a parent item which has the proper link is the "contact" item (which has no children)
All the other parent items are assigned page links, except for "about".
The support agent suggested maybe my CSS could be causing this, however my CSS is fairly standard/based off the articles in the knowledgebase, and I'm not seeing anything that (as far as I know) would remove an href attribute from an element.
Any help is appreciated. I may not be able to provide all of our code, since this work is for a client, however you can view the relevant CSS in the browser inspector.
Parent Menu Item Links are being removed in frontend HTML
Try updating the href of about us - looks like it is set to trigger javascript, whereas the other parent links are pointing to the destination URL. (when you view source, you can see the difference in the href's)
Parent Menu Item Links are being removed in frontend HTML
So some parents are links and some aren't?
From a User Experience perspective it should be consistent across the board. Might be better to add a general link as the first item in each dropdown (overview) rather than the mix and then make all the parent items non-links.... just my .02 🙂
This line was added, because if not present, a strange bug appears; I have commented out the line for now, so you can recreate the bug for yourself:
Note: this only occurs on mobile menu (so tablet or mobile view of your choice in inspector)
1. Open the menu using the menu icon 2. Click on "about" (not on the plus sign, but on about itself) - Now the about submenu is open. 3. Now, try to click the plus sign on another menu item to open the submenu
Sometimes, this causes you to visit another page. Other times, this causes the wrong submenu to open. Depends on which item you click after clicking "about", it seems.
This is a strange bug, and the only way I could figure to quickfix it was to remove hrefs from siblings. However, this was before I had actually added links, so now that I've added links, it's not ideal.