iPad/iPhone hover problem causes the user to double click a link

后端 未结 26 1754
太阳男子
太阳男子 2020-11-27 09:18

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 inst

26条回答
  •  被撕碎了的回忆
    2020-11-27 09:58

    To get the links working without breaking touch scrolling, I solved this with jQuery Mobile's "tap" event:

        $('a').not('nav.navbar a').on("tap", function () {
            var link = $(this).attr('href');
            if (typeof link !== 'undefined') {
                window.location = link;
            }
        });
    

提交回复
热议问题