我添加此代码
document.addEventListener('touchmove', function(event) {
if (event.touches.length > 1) {
event.preventDefault();
event.stopPropagation();
}
},
{
passive: false
});
当您不移动页面时它会起作用。但是当您滚动页面并同时捏合缩放页面时,页面仍然可以缩放。
有什么方法可以填补这种情况吗?
const $body = document.querySelector('body');
$body.style.overflow = 'hidden';