- This topic has 13 replies, 3 voices, and was last updated 6 years ago by Tom.
-
AuthorPosts
-
March 19, 2018 at 8:15 am #523735Andrew
Hi All,
I noticed on an iPad my menu items require two clicks to go to the item. It’s treating the first click the same way it would treat hover on desktop. Is there a way to make it go on the first click, but retain the hover function on desktop?
March 19, 2018 at 12:09 pm #523940LeoStaffCustomer SupportHi there,
Just checked on iPad and not noticing this issue.
Are you using the most recent version of GPP 1.5.6?
March 20, 2018 at 9:06 pm #525053AndrewHi Leo,
Yes I’m using the latest GPP 1.5.6.
Sorry, I should have clarified that the menu has the issue when the iPad is held in a landscape orientation. The mobile slide out menu works fine in portrait.
March 20, 2018 at 10:32 pm #525110TomLead DeveloperLead DeveloperIf you disable the underline effect, does the issue go away?
March 21, 2018 at 7:42 pm #525921AndrewI temporarily removed the CSS and the issue went away. Is there a way to keep the underline effect and have it go on the first click on an iPad?
Thanks for all your help!
March 21, 2018 at 9:20 pm #525981TomLead DeveloperLead DeveloperCan you re-post the CSS you’re using in here?
March 22, 2018 at 8:11 am #526437AndrewHere’s all the CSS I’ve added…
.site-header {
display: none;
}.menu-text {
position: relative;
}.main-navigation .menu > .menu-item > a .menu-text::after {
content: “”;
position: absolute;
right: 20;
left: 50%;
bottom: -10px;
transform: translateX(-50%);
display: block;
width: 0;
height: 3.0px;
background-color: currentColor;
transition: 0.5s width ease, 500ms opacity ease;
opacity: 0;
}.main-navigation .menu > .menu-item.current-menu-item > a .menu-text::after,
.main-navigation .menu > .menu-item.current-menu-ancestor > a .menu-text::after,
.main-navigation .menu > .menu-item > a:hover .menu-text::after {
width: 100%;
opacity: 1;
}
@media (max-width: 768px) {
.page-header-content {
height: auto !important;
min-height: 300px;
background-size: 100% auto;
}
}March 22, 2018 at 8:44 pm #527242TomLead DeveloperLead DeveloperiOS is weird when it comes to doing things on hover. If it detects an effect, it will treat a click like a hover event.
You can try changing this:
.main-navigation .menu > .menu-item > a:hover .menu-text::after
To this:
.main-navigation .menu > .menu-item:hover > a .menu-text::after
March 23, 2018 at 8:33 am #528074AndrewThat didn’t seem to change anything.
Is there any other way you can think of?Thanks for all your effort on this.
March 23, 2018 at 8:30 pm #528788TomLead DeveloperLead DeveloperUnfortunately it looks like JS is the only answer: https://stackoverflow.com/questions/3038898/ipad-iphone-hover-problem-causes-the-user-to-double-click-a-link
March 28, 2018 at 8:24 am #533934AndrewSorry I’m very new at all this. I’m having trouble figuring out what to do from the link. Could you clarify/guide me a little more.
March 28, 2018 at 9:13 pm #534563TomLead DeveloperLead DeveloperYou could try adding this to the wp_footer hook:
<script> jQuery('.main-navigation a').on('click touchend', function(e) { var el = $(this); var link = el.attr('href'); window.location = link; }); </script>
March 29, 2018 at 8:22 am #535204AndrewWorked like a charm. Thanks Tom, you’re awesome!
March 29, 2018 at 10:31 am #535357TomLead DeveloperLead DeveloperGlad I could help 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.