Win7 + IE 應用需禁用多點觸控(縮放、平移),但保留系統其他程序觸控。
IE 10/11 支持指針事件(`pointerdown` 等)及觸摸事件(`touchstart` 等)。在頁面頂層捕獲並阻止:
["touchstart", "touchmove", "touchend", "touchcancel"].forEach(function(evt) {
document.addEventListener(evt, function(e) {
if (e.touches.length > 1) { // 多點觸控
e.preventDefault(); // 阻止瀏覽器默認縮放/平移
}
}, { passive: false }); // 必須 passive: false 才能 preventDefault
});
html, body { touch-action: none; }
此法更簡潔,無需 JS,推薦優先使用。