In fact, micro-channel official document which has been given a very detailed procedure (For details, please refer to https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html ) on which the relevant micro-letter web development document, which contains the authorization page, weui and js-sdk;
Questions 1. In a letter made public when the number of micro encounter
Due to the impact of mobile phone screen size, fit is the most me a headache; the Internet to find the most is using rem to achieve the purpose of adaptation.
1 !(function(win, doc) { 2 function setFontSize() { 3 // 获取window 宽度 4 var winWidth = window.innerWidth; 5 doc.documentElement.style.fontSize = (winWidth / 750) * 100 + 'px'; 6 } 7 var evt = 'onorientationchange' in win ? 'orientationchange' : 'resize'; 8 var timer = null; 9 win.addEventListener(evt, function() { 10 clearTimeout(timer); 11 12 timer = setTimeout(setFontSize, 300); 13 }, false); 14 win.addEventListener("pageshow", function(e) { 15 if (e.persisted) { 16 clearTimeout(timer); 17 18 timer = setTimeout(setFontSize, 300); 19 } 20 }, false); 21 //初始化 22 setFontSize(); 23 }(window, document));