1//author:caibaojian 2//å ¼å®¹UCç«å±è½¬æ¨ªå±åºç°çBUG 3//èªå®ä¹è®¾è®¡ç¨¿ç宽度ï¼designWidth 4//æå¤§å®½åº¦:maxWidth 5//è¿æ®µjsçæåé¢æä¸¤ä¸ªåæ°è®°å¾è¦è®¾ç½®ï¼ä¸ä¸ªä¸ºè®¾è®¡ç¨¿å®é 宽度ï¼ä¸ä¸ªä¸ºå¶ä½ç¨¿æå¤§å®½åº¦ï¼ä¾å¦è®¾è®¡ç¨¿ä¸º828ï¼æå¤§å®½åº¦ä¸º828ï¼å为(828,828) 6;(function(designWidth, maxWidth) { 7 var doc = document, 8 win = window, 9 docEl = doc.documentElement, 10 remStyle = document.createElement("style"), 11 tid; 12 13 function refreshRem() { 14 var width = docEl.getBoundingClientRect().width; 15 maxWidth = maxWidth || 540; 16 width>maxWidth && (width=maxWidth); 17 var rem = width * 100 / designWidth; 18 remStyle.innerHTML = 'html{font-size:' + rem + 'px;}'; 19 } 20 21 if (docEl.firstElementChild) { 22 docEl.firstElementChild.appendChild(remStyle); 23 } else { 24 var wrap = doc.createElement("div"); 25 wrap.appendChild(remStyle); 26 doc.write(wrap.innerHTML); 27 wrap = null; 28 } 29 //è¦ç wiewport 设置好åæè½æ§è¡ refreshRemï¼ä¸ç¶ refreshRem 伿§è¡2æ¬¡ï¼ 30 refreshRem(); 31 32 win.addEventListener("resize", function() { 33 clearTimeout(tid); //鲿¢æ§è¡ä¸¤æ¬¡ 34 tid = setTimeout(refreshRem, 300); 35 }, false); 36 37 win.addEventListener("pageshow", function(e) { 38 if (e.persisted) { // æµè§å¨åéçæ¶åéæ°è®¡ç® 39 clearTimeout(tid); 40 tid = setTimeout(refreshRem, 300); 41 } 42 }, false); 43 44 if (doc.readyState === "complete") { 45 doc.body.style.fontSize = "16px"; 46 } else { 47 doc.addEventListener("DOMContentLoaded", function(e) { 48 doc.body.style.fontSize = "16px"; 49 }, false); 50 } 51})(750, 750);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.