Skip to content

Instantly share code, notes, and snippets.

View cold-coder's full-sized avatar
🎯
Focusing

Yao Cheng cold-coder

🎯
Focusing
View GitHub Profile
@cold-coder
cold-coder / refreshRem.js
Created March 16, 2017 09:48
Page Rem Calculation
;
(function(win) {
var doc = win.document;
var docEl = doc.documentElement;
var tid;
function refreshRem() {
var width = docEl.getBoundingClientRect().width;
if (width > 540) { // 最大宽度
width = 540;