disable Double tap zoom/resize on safari IOS12***

走远了吗. 提交于 2020-01-14 04:24:05

问题


I search 99% website on internet... nope answer can solve my problem..i am using ios 12... does any jQuery can totally disable safari double tap now???

or can I have some code detect function when(if user is double tapped?

I spend 2weeks for that i still not find the solution.. This is what i tried... CSS: *{-webkit-text-size-adjust: none;zoom:1;touch-action: manipulation;} *{cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)} and disable viewport zooming iOS 10+ safari?

I hate safari..


回答1:


Adding an empty click listener on HTML elements will prevent double tap zoom.

It's ugly but does the job.

myElement.addEventListener("click", event => {});

Next thing i'm trying to figure out to disable all zooming is preventing pinch.

Unfortunately, touch events are not dispatched during iOs momentum scrolling. The following code works as long as the page is not scrolling (tested only on 12.2) :

document.addEventListener("touchstart", event => {
    if(event.touches.length > 1) {
        console.log("zoom plz stahp");
        event.preventDefault();
        event.stopPropagation(); // maybe useless
    }
}, {passive: false});


来源:https://stackoverflow.com/questions/56024398/disable-double-tap-zoom-resize-on-safari-ios12

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!