Jump to content

In WordPress, how can you disable the first tap of parent menu, for tablets?


simona6

Recommended Posts

We have come across a problem, that is solved on many other websites. Let's say you have a shop website, with Mens, Womens, Housing... and so on.

On Desktop you hover over Mens and up comes the menu. But on Tablet, you tap on Mens and up comes the menu. But in WordPress this doesn't happen. when you Tap Mens it goes to the Mens page.

Is there a simple JS or Functions.php that can be added, so that the 'first tap' simply expands the menu, and a second tap opens the page.

Great examples are these: https://www.johnlewis.com https://www.houseoffraser.co.uk

Both have main menus, and the dropdowns work. and only open their parent pages on the SECOND tap. You might select Mens or Womens, and the dropdown menu appears. When you select Mens again, it goes to the 'Mens' page.

How do you achieve this in WordPress?

I found this possible answer: https://www.tbare.com/2014/04/disable-click-on-wordpress-parent-menu-with-children/, but annoyingly, his answer is how to disable it completely, but is it a means to a solution?

I want his "Safari on iOS handles SuperFish pretty well – the first tap drops down the menu, and the second tap will actually take you to that page".....

Can his coding be tweaked so that for these parent menu links, they open the page on 'taps'... on only the second tap?

Can someone please help, so we can add a script that does it perfectly?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.