The pinch zoom feature is typically enabled by default on mobile devices and is controlled by the browser itself, rather than the HTML page. However, there are a few methods to disable pinch zoom on an HTML page.
One method is to use the CSS property touch-action
to disable touch events, including pinch zoom:
* {
touch-action: manipulation;
}
Another method is to use JavaScript to prevent the default behavior of touch events, such as pinch zoom:
document.addEventListener('touchmove', function(event) {
event.preventDefault();
}, false);
It's important to note that disabling pinch zoom can negatively impact the user experience for some users, particularly those with visual impairments or motor disabilities. If possible, it's recommended to provide alternate navigation options or accessibility features instead of disabling pinch zoom altogether.
Asked: 2023-06-18 13:18:30 +0000
Seen: 9 times
Last updated: Jun 18 '23