Adjust font size to solve the micro-channel page style chaos lead to problems

Micro adjust the font size of the letter has a function, but sometimes adjust the font size will lead to pages within the H5 micro-channel public number style chaos.
Solving principle: prevent ios and Android adjust the font size of the event time. ios css property by adding, to stop Andrews through micro channel properties.

Note: After you add the font size can not be changed by external use according to the project requirements.

ios system:

body{
    -webkit-text-size-adjust: 100% !important;
}

Android system:

(function() {
    if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
        handleFontSize();
    } else {
        document.addEventListener("WeixinJSBridgeReady", handleFontSize, false);
    }
    function handleFontSize() {
        // 设置网页字体为默认大小
        WeixinJSBridge.invoke('setFontSizeCallback', { 'fontSize' : 0 });
         // override the settings page font size event 
        WeixinJSBridge.on ( ' MENU: setFont ' , function () { 
            WeixinJSBridge.invoke ( ' setFontSizeCallback ' , { ' the fontSize ' : 0 }); 
        }); 
    } 
} ) ();

 NOTE: Andrews JS using the micro-letter Bridge.

Guess you like

Origin www.cnblogs.com/luoyihao/p/12385975.html