Disable Pinch to Zoom

Someone wrote in and shared a technique over in the next.js repo to disable pinch to zoom that might be useful to others. Just place this in the Head HTML area to disable and pinch to zoom gestures. This is especially handy if you're running your Hype document in a kiosk environment.

<script>
document.addEventListener("gesturestart", function (e) {
	e.preventDefault();
    document.body.style.zoom = 0.99;
});

document.addEventListener("gesturechange", function (e) {
	e.preventDefault();

  document.body.style.zoom = 0.99;
});
document.addEventListener("gestureend", function (e) {
	  e.preventDefault();
    document.body.style.zoom = 1;
});
</script>
3 Likes