How can I disable the enlargement of the website by two new ones on the mobile device?
I’ve already tried everything, but unfortunately it still lets me.
Can someone help? Unfortunately, it would be quite urgent, I don’t have time now.
Yes, but in the meantime I solved it with the small script below.
(function () {
function disableZoom() {
// Megakadályozza a nagyítást a gesturestart eseményen keresztül
document.addEventListener('gesturestart', function (e) {
e.preventDefault();
});
// Megakadályozza a dupla koppintást a nagyításra a touchend eseményen keresztül
var lastTouchEnd = 0;
document.addEventListener('touchend', function (e) {
var now = new Date().getTime();
if (now - lastTouchEnd <= 300) {
e.preventDefault();
}
lastTouchEnd = now;
}, false);
// Megakadályozza a nagyítást a többszörös ujjal való érintésen keresztül
var touchCount = 0;
document.addEventListener('touchstart', function (e) {
touchCount += e.touches.length;
if (touchCount > 1) {
e.preventDefault();
}
});
// Ellenőrzi a touchend eseményeket a touchstart események után
document.addEventListener('touchend', function () {
touchCount = 0;
});
}
// Oldal betöltésekor futtatjuk a funkciót
window.addEventListener('load', disableZoom);
})();