我試過了:
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=0"/>
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
和
body {
touch-action: manipulation !important;
}
什么都沒用,我仍然有safari上的雙擊和iOS上的chrome。
有什么想法嗎?謝謝你。
CSS全局禁用雙擊縮放:
* {
touch-action: manipulation;
}
編輯:
我在裝有IOS v14.4.2的IPhone 7 Plus上測試了它,它對我有效。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>No double tap</title>
<style>
.no-double-tap {
touch-action: manipulation;
}
</style>
</head>
<body>
<h2>no double tap</h2>
<img class="no-double-tap" src="https://picsum.photos/id/1/200/300">
<h2>double tap</h2>
<img src="https://picsum.photos/id/2/200/300">
</body>
</html>
body{
touch-action: manipulation;
}
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=0"/>