
本文共 1631 字,大约阅读时间需要 5 分钟。
������������������������������������������������������������������������������������������������������������������������������px������������������������������������������������������rem���������������������������������������������������������������������������������������������������������������������������rem������������������
rem���������������������������������������������������������������������������������������������������������������rem���px������������������������
���UI���������������������������750px���������������������������������������������������������������������750px���������������rem���������������������������������������
(function(doc, win) { var docEl = doc.documentElement, resizeEvt = "orientationchange" in window ? "orientationchange" : "resize", recalc = function() { var clientWidth = docEl.clientWidth; if (!clientWidth) return; if (clientWidth > 750) { docEl.style.fontSize = "100px"; // ������������������750������������������100px } else { docEl.style.fontSize = 100 * (clientWidth / 750) + "px"; } /* * 100 -> html,body { font-size:100px; } * 750 -> ��������� iPhone6 ��������������� ������750px ������������ * ��������������������������������������� */ };if (!doc.addEventListener) return; win.addEventListener(resizeEvt, recalc, false); doc.addEventListener("DOMContentLoaded", recalc, false);})(document, window);
������������������������window���resize���������������������������������������������������������������������������������rem������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
