惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
云风的 BLOG
云风的 BLOG
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
GbyAI
GbyAI
C
Check Point Blog
M
MIT News - Artificial intelligence
T
The Blog of Author Tim Ferriss
Jina AI
Jina AI
博客园 - 【当耐特】
U
Unit 42
月光博客
月光博客
腾讯CDC
Y
Y Combinator Blog
小众软件
小众软件
博客园_首页
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
The GitHub Blog
The GitHub Blog
博客园 - 聂微东
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
T
Tailwind CSS Blog

博客园 - 君临天下之徐少

nvm安装 Homebrew 安装 Less的优点 什么是nrm js 处理大数相减 React函数式组件值之useRef()和useImperativeHandle() 谷歌刷题插件安装 SSL certificate problem: unable to get local issuer certificate 错误解决 常用命令 Mac安装Nvm Node开发环境 解决Mac安装Homebrew失败 Canvas学习:globalCompositeOperation详解 React.CreateContext html让容器居中,css让容器水平垂直居中的7种方式 js下载文件防止白屏 GitHub上README.md编写教程(基本语法) G6-Editor 编辑器入门使用教程 git reset 加不加 --hard的区别 taro, h5拨打电话和发送短信
微信字体大小调整导致的H5页面错乱问题处理
君临天下之徐少 · 2021-01-05 · via 博客园 - 君临天下之徐少

当用户调整微信字体大小时会导致H5页面错乱,解决方案如下:

ios:在css中加入-webkit-text-size-adjust: 100% !important;

  1. -webkit-text-size-adjust: 100% !important;

安卓:借助WeixinJSBridge对象来阻止字体大小调整,将此段代码放在在程序的入口页面(例如 index.html / index.ejs等)即可

  1. if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {

  2. document.addEventListener("WeixinJSBridgeReady", handleFontSize, false);

  3. function handleFontSize () {

  4. WeixinJSBridge.invoke('setFontSizeCallback', { 'fontSize' : 0 });

  5. WeixinJSBridge.on('menu:setfont', function() {

  6. WeixinJSBridge.invoke('setFontSizeCallback', { 'fontSize' : 0 });