From 587ea50f48af8f480cc4bcac5adba4eae74fd8ad Mon Sep 17 00:00:00 2001 From: fzred <1179750402@qq.com> Date: Tue, 23 Aug 2016 16:52:11 +0800 Subject: [PATCH] =?UTF-8?q?fix=20android=20webview=20=E9=87=8C=20html=20fo?= =?UTF-8?q?nt-size=20=E5=9B=A0=E8=AE=BE=E7=BD=AE=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=AD=97=E4=BD=93=E5=A4=A7=E5=B0=8F=E5=8F=97=E5=88=B0=E5=BD=B1?= =?UTF-8?q?=E5=93=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/flexible.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/flexible.js b/src/flexible.js index 4e7c545..3fd98a7 100644 --- a/src/flexible.js +++ b/src/flexible.js @@ -72,6 +72,11 @@ } var rem = width / 10; docEl.style.fontSize = rem + 'px'; + var realitySize = parseInt(window.getComputedStyle(document.documentElement).fontSize); + if (rem !== realitySize) { + rem = rem * rem / realitySize; + docEl.style.fontSize = rem + 'px'; + } flexible.rem = win.rem = rem; }