iPad/iPhone hover problem causes the user to doubl

2020-01-24 18:41发布

I have some websites I built times ago, that use jquery mouse events...I just got an ipad and i noticed that all the mouse over events are translated in clicks...so for instance i have to do two clicks instead of one..(the first hover, than the actual click)

is there a workaround ready to solve this? maybe a jquery command i shoudl have used instead of mouseover/out etc.. thanks!

25条回答
我想做一个坏孩纸
2楼-- · 2020-01-24 19:23

This short snippet seems to work. Trigger the click event when link tapped :

  $('a').on('touchstart', function() {
    $(this).trigger('click');
  });
查看更多
登录 后发表回答