简体   繁体   English

悬停链接需要双击

[英]Link with hover need double click

I have a problem with an apple on my site. 我的网站上的苹果有问题。 All buttons that have a "hover" event in CSS require to double click on it. CSS中所有具有“悬停”事件的按钮都需要双击。 The first click triggers the "hover" and the second triggers the redirection 第一次点击触发“悬停”,第二次触发重定向

I would like to know if it was possible not to trigger the "hover" but to redirect to the link at the first click. 我想知道是否有可能不触发“悬停”而是在第一次单击时重定向到链接。

I found this piece of code but makes the click very sensitive if the scroll while pressing a link, link is triggered 我找到了这段代码,但是如果在按下链接时滚动并触发了链接,则单击非常敏感

var device = navigator.userAgent.toLowerCase();
var ios = device.match(/(iphone|ipod|ipad)/)
if (ios) {
   $('a').on('click touchend', function(e) {
       var el = $(this);
       var link = el.attr('href');
       window.location = link;
   });
}

我不确定,但是可以在CSS中解决...这是一个UX问题请检查: https : //css-tricks.com/annoying-mobile-double-tap-link-issue/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM