首页 > 代码库 > 微信字体大小禁止调整

微信字体大小禁止调整

 1 (function() {
 2     if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
 3         handleFontSize();
 4     } else {
 5         if (document.addEventListener) {
 6             document.addEventListener("WeixinJSBridgeReady", handleFontSize, false);
 7         } else if (document.attachEvent) {
 8             document.attachEvent("WeixinJSBridgeReady", handleFontSize);
 9             document.attachEvent("onWeixinJSBridgeReady", handleFontSize);
10         }
11     }
12     function handleFontSize() {
13         WeixinJSBridge.invoke(‘setFontSizeCallback‘, { ‘fontSize‘ : 0 });
14         WeixinJSBridge.on(‘menu:setfont‘, function() {
15             WeixinJSBridge.invoke(‘setFontSizeCallback‘, { ‘fontSize‘ : 0 });
16         });
17     }
18 })();
19 
20 $(function(){
21     $(body).css(‘-webkit-text-size-adjust‘,‘100%‘);
22 })

 参考链接:http://gold.xitu.io/entry/578133ad8ac2470061eb5e94

微信字体大小禁止调整