You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
719 B
36 lines
719 B
window.onload = function() {
|
|
|
|
document.addEventListener('touchstart', function(event) {
|
|
if (event.touches.length > 1) {
|
|
event.preventDefault();
|
|
}
|
|
|
|
});
|
|
|
|
document.addEventListener('gesturestart', function(event) {
|
|
event.preventDefault();
|
|
});
|
|
};
|
|
|
|
|
|
|
|
// 禁用双指放大
|
|
document.documentElement.addEventListener('touchstart', function(event) {
|
|
if (event.touches.length > 1) {
|
|
event.preventDefault();
|
|
}
|
|
}, {
|
|
passive: false
|
|
});
|
|
|
|
// 禁用双击放大
|
|
var lastTouchEnd = 0;
|
|
document.documentElement.addEventListener('touchend', function(event) {
|
|
var now = Date.now();
|
|
if (now - lastTouchEnd <= 300) {
|
|
event.preventDefault();
|
|
}
|
|
lastTouchEnd = now;
|
|
}, {
|
|
passive: false
|
|
});
|
|
|