mobile menu with anchor links issue
-
I am having an issue with a submenu of anchor links on mobile.
I created a submenu with anchor links for various spots on the home page. It works fine on desktop, but on mobile, the menu does not close after you click on one of the links. From googling this issue, it looks like this is not specific to WordPress or to my theme (Thesis). You can see this problem by looking on mobile (or on desktop with a narrow enough viewport that the three-line menu appears) and clicking on Benefits > Improve.I employed the fix suggested in this thread, and that worked. The fix is basically that instead of having site.com/#anchor, you change it to site.com/?location=1#anchor. If you click on Benefits and any of the submenus other than Improve, you will see that this works just fine. The menu disappears, as it should.
Problem is that this fix then breaks Responsive Lightbox.
If you go to the home page, scroll down and click on any of the thumbnail images, the lightbox effect works. If you click on any of these links in the orange bar (which are simply links, not a WordPress menu), the effect works.
But if you click on Benefits and any of those first three submenu items, and click on the same exact thumbnail, it opens the image, but without the lightbox effect: no close button, entire background is black rather than dark. I assume that the ?location is somehow interfering with lightbox.
Another clue to the mobile/anchor issue: If you’re on a page other than home, the Improve menu works OK: the page changes and the menu disappears. So the issue appears to be specific to going to an anchor link on the same page.
I’ve googled the issue and found some threads such as this one, but I’m not a javascript/jquery person, and wouldn’t even know where to add the code if I knew what code to use.
- The topic ‘mobile menu with anchor links issue’ is closed to new replies.