[ad_1]
I attempted to make use of “user-scalable=no” within the meta tag to disable zooming on cellular webpage, but it surely’s not engaged on Safari. Due to this fact I attempted to make use of javascript (code beneath) to manage it, but it surely additionally failed. Is there one other technique to disable zooming of Safari?
doc.addEventListener('touchstart', (occasion) => {
if (occasion.touches.size > 1) {
occasion.preventDefault();
}
}, { passive: false });
let lastTouchEnd = 0;
doc.addEventListener('touchend', (occasion) => {
const now = (new Date()).getTime();
if (now - lastTouchEnd <= 300) {
occasion.preventDefault();
}
lastTouchEnd = now;
}, false);
}```
[ad_2]
