站点工具

用户工具


====== 差别 ======

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

移动端_viewport适配 [2021/09/16 14:57]
admin 创建
移动端_viewport适配 [2021/09/16 14:59] (当前版本)
admin
行 22: 行 22:
  
 ## 适配代码 ## 适配代码
-```css + 
-<!DOCTYPE html> +把以下JS代码放在head标签内。 
-<html> + 
-<head> +```javascript
-  <meta charset="utf-8"> +
-  <script>+
     const WIDTH = 750     const WIDTH = 750
     const mobileAdapter = () => {     const mobileAdapter = () => {
行 42: 行 40:
     mobileAdapter()     mobileAdapter()
     window.onorientationchange = mobileAdapter     window.onorientationchange = mobileAdapter
-  </script> 
-</head> 
-<body> 
- ... 
-</body> 
-</html> 
 ``` ```
  
admin · 2021/09/16 14:57 · 移动端_viewport适配.1631775433.txt.gz