PageSourceSearch

http://www.liannan.gov.cn/global/pe-font-size.js

js liannan.gov.cn collected 2026-10-02 20:59:07 UTC 1,327 bytes, 42 lines download raw bytes

1/*
2*调整字体大小
3*id:内容ID
4*type:类型{l:最大,s:最小,m:中;magnify:增加,lessen:缩小}
5*/
6var adjustFontSize=function(){
7    var tagType = new Array('div', 'td', 'tr', 'font', 'p', 'span');
8    var fontsizePx = 16,
9        maxSize=30,
10        minSize=12; 
11    var setFontSize =function(id, type) {
12        if (!document.getElementById) return;
13        var d = document, cEl = null, i, j, cTags;
14    
15        if(type == "l"){
16            fontsizePx = 36;
17        }else if(type == "s"){
18            fontsizePx = 16;
19        }else if(type == "m"){
20            fontsizePx = 24;
21        }
22        else if(type == "magnify" && fontsizePx <maxSize){
23            fontsizePx += 2;
24        }
25        else if(type == "lessen" && fontsizePx >minSize){
26            fontsizePx -= 2;
27        }
28    
29        if (!(cEl = d.getElementById(id))) cEl = d.getElementsByTagName(id)[0];
30        cEl.style.fontSize = fontsizePx + "px";
31        cEl.style.lineHeight=2;
32    
33        for (i = 0; i < tagType.length; i++) {
34            cTags = cEl.getElementsByTagName(tagType[i]);
35            for (j = 0; j < cTags.length; j++){
36                cTags[j].style.fontSize = fontsizePx + "px";
37                cTags[j].style.lineHeight=2;
38            }
39        }
40    }
41    return setFontSize;
42}();

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.