PageSourceSearch

https://www.plapla.com.mx/plapla/deferintroduce/rem.js

js plapla.com.mx collected 2026-09-24 13:36:51 UTC 922 bytes, 35 lines download raw bytes

1var comlist = [];//定义变量数组用于暴露匿名函数内部的变量
2(function(win) {
3    var doc = win.document;
4    var docEl = doc.documentElement;
5    var tid;
6    var comsize = 0; //用于暴露页面rem值
7
8    function refreshRem() {
9        var width = docEl.getBoundingClientRect().width;
10        //console.log(width)
11        if (width > 540) {
12            width = 540;
13        }
14        var rem = width / 10;
15        docEl.style.fontSize = rem + 'px';
16        comsize = rem;
17        if(window.comlist){
18            win.comlist.push(comsize)
19        }
20    }
21
22    win.addEventListener('resize', function() {
23        clearTimeout(tid);
24        tid = setTimeout(refreshRem, 300);
25    }, false);
26    win.addEventListener('pageshow', function(e) {
27        if (e.persisted) {
28            clearTimeout(tid);
29            tid = setTimeout(refreshRem, 300);
30        }
31    }, false);
32
33    refreshRem();
34
35})(window);

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.