PageSourceSearch

https://www.jingyuan.gov.cn/cms_files/filemanager/947189616/script/20241/8d3ae064f78248c7820b020441419dba.js

js jingyuan.gov.cn collected 2026-10-07 21:22:04 UTC 9,670 bytes, 302 lines download raw bytes

1/*字体重定义为10px*/
2(function (doc, win) {
3    var docEl = doc.documentElement,
4        resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
5        recalc = function () {
6            var clientWidth = docEl.clientWidth;
7            if (!clientWidth) return;
8            if (clientWidth >= 640) {
9                docEl.style.fontSize = '10px';
10            } else {
11                docEl.style.fontSize = '10px';
12            }
13        };
14
15    if (!doc.addEventListener) return;
16    win.addEventListener(resizeEvt, recalc, false);
17    doc.addEventListener('DOMContentLoaded', recalc, false);
18})(document, window);
19
20
21//判断IE8-
22/*(function(window) {
23    var theUA = window.navigator.userAgent.toLowerCase();
24    if ((theUA.match(/msie\s\d+/) && theUA.match(/msie\s\d+/)[0]) || (theUA.match(/trident\s?\d+/) && theUA.match(/trident\s?\d+/)[0])) {
25        var ieVersion = theUA.match(/msie\s\d+/)[0].match(/\d+/)[0] || theUA.match(/trident\s?\d+/)[0];
26        if (ieVersion < 9) {
27            var str = "你的浏览器版本太低了 :(";
28            var str2 = "推荐使用:<a style='color:#cc0'>360极速</a>,"
29                + "<a href='http://www.firefox.com.cn/' target='_blank' style='color:#cc0'>火狐</a>,"
30                + "<a href='https://www.liebao.cn/' target='_blank' style='color:#cc0'>猎豹</a>,其他双核急速模式";
31            document.writeln("<pre style='text-align:center;color:#fff; height:100%;border:0;position:fixed;top:0;left:0;width:100%;z-index:1234'>" +
32                "<h2 style='padding-top:200px;margin:0'><strong>" + str + "<br/></strong></h2><p>" +
33                str2 + "</p><h2 style='margin:0'><strong>如果你的使用的是双核浏览器,请切换到极速模式访问<br/></strong></h2></pre>");
34            document.execCommand("Stop");
35        };
36    }
37})(window);*/
38
39
40// 移动端nav
41$(function () {
42
43    var right = $('.u-wap-nav');
44    var bg = $('.m-mask');
45    var rightNav = $('.m-wapnav-body');
46
47    showNav(right, rightNav, "right");
48
49    function showNav(btn, navDiv, direction) {
50        btn.on('click', function () {
51            bg.css({
52                display: "block",
53                transition: "opacity .5s"
54            });
55            $("body").css({
56                /* overflowY:"hidden" */
57                position: "fixed",
58                width: "100%",
59                height: "100%"
60            });
61            if (direction == "right") {
62                navDiv.css({
63                    right: "0px",
64                    transition: "right .5s"
65                });
66            } else if (direction == "left") {
67                navDiv.css({
68                    left: "0px",
69                    transition: "left 1s"
70                });
71            } else if (direction == "up") {
72                navDiv.css({
73                    top: "0px",
74                    transition: "top 1s"
75                });
76            } else if (direction == "down") {
77                navDiv.css({
78                    bottom: "0px",
79                    transition: "bottom 1s"
80                });
81            }
82        });
83    }
84
85    bg.on('click', function () {
86        hideNav();
87    });
88
89    function hideNav() {
90        rightNav.css({
91            right: "-50%",
92            transition: "right .5s"
93        });
94        bg.css({
95            display: "none",
96            transition: "display 1s"
97        });
98        $("body").css({
99            position: "absolute"
100        });
101    }
102    //计算导航高度
103    var num = 2;
104    if ($(window).width() < 768) {
105        var num = 3;
106    }
107    else {
108        var num = 2;
109    }
110    var wapNavTop = Number($(".g-banner").css("height").slice(0, -2)) / num;
111    $(".m-wap-nav").css("margin-top", (wapNavTop + 2) + "px");
112});
113$(function () {//字体大中小
114    $(".switchsize span").click(function () {
115        //获取para的字体大小
116        var thisEle = $(".m-txt-article p,.m-txt-article,.m-txt-article font,.m-txt-article span,.m-txt-article div").css("font-size");
117        //parseFloat的第二个参数表示转化的进制,10就表示转为10进制
118        var textFontSize = parseFloat(thisEle, 10);
119        //javascript自带方法
120        var unit = thisEle.slice(-2); //获取单位
121        var cName = $(this).attr("class");
122        if (cName == "bigger") {
123            if (textFontSize <= 22) {
124                textFontSize += 2;
125            }
126        } else if (cName == "smaller") {
127            textFontSize -= 2;
128        }
129        $(".m-txt-article p,.m-txt-article,.m-txt-article font,.m-txt-article span,.m-txt-article div").css("font-size", textFontSize + unit);
130    });
131    $(".switchsize .medium").click(function () {
132        $(".m-txt-article p,.m-txt-article,.m-txt-article font,.m-txt-article span,.m-txt-article div").css("font-size", "18px");
133    })
134
135    var printAreaCount = 0;
136    $.fn.printArea = function () {
137        var ele = $(this);
138        var idPrefix = "printArea_";
139        removePrintArea(idPrefix + printAreaCount);
140        printAreaCount++;
141
142        var iframeId = idPrefix + printAreaCount;
143
144        var iframeStyle = 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;';
145        iframe = document.createElement('IFRAME');
146        $(iframe).attr({
147            style: iframeStyle,
148            id: iframeId
149        });
150        document.body.appendChild(iframe);
151        var doc = iframe.contentWindow.document;
152
153        $(document).find("link").filter(function () {
154            return $(this).attr("rel").toLowerCase() == "stylesheet";
155        }).each(
156            function () {
157                doc.write('<link type="text/css" rel="stylesheet" href="'
158                    + $(this).attr("href") + '">');
159            });
160        doc.open();
161        doc.write($(ele).prop('outerHTML'));
162        doc.close();
163        var frameWindow = iframe.contentWindow;
164        frameWindow.close();
165        frameWindow.focus();
166        frameWindow.print();
167    }
168    var removePrintArea = function (id) {
169        $("iframe#" + id).remove();
170    };
171    //打印调用
172    $("#btnPrint").click(function () {
173        print();
174        $("#article").css("font-size", "18px");
175        $("#article").css("line-height", "32px");
176    });
177
178    //回到顶部
179    $(".back_top").hide(); //首先将.back_top隐藏
180    $(window).scroll(function () {
181        if ($(window).scrollTop() > 0) {
182            $(".back_top").fadeIn(400);
183        } else {
184            $(".back_top").fadeOut(400);
185        }
186    }); //当滚动条的位置处于距顶部100像素以下时,跳转链接出现,否则消失
187    $(".back_top a").click(function () {
188        $('body,html').animate({
189            scrollTop: 0
190        }, 200);
191        return false;
192    }); //当点击跳转链接后,回到页面顶部位置
193
194    //设置左侧最小高度
195    var leftHeight = $('.leftPart').height();
196    var rightHeight = $('.rightPart').height();
197    if (leftHeight < rightHeight) {
198        $('.leftPart').height(rightHeight);
199    }
200
201});
202
203//微信微博侧边栏
204
205function closeDuilian() {
206    $("#toTop").remove();
207
208}
209
210
211function monitorWidth() {
212    var document_w = $(document).width();
213
214    var obj = $("#toTop");
215
216    if (document_w < 1206) {
217        obj.hide();
218
219    } else {
220        obj.show();
221    }
222}
223
224$(window).resize(function () {
225    monitorWidth();
226
227});
228
229$(document).ready(function () {
230
231
232    var obj = $("div.duilian");
233    if (obj.length > 0) {
234        var bodyHeight = $(document).height();
235        var dlHeight = $(".duilian").height();
236        var topHeight = $(".duilian").css("top");
237        topHeight = topHeight.substring(0, topHeight.length - 2);
238        topHeight = parseInt(topHeight);
239        $(window).scroll(function () {
240            var scrollTop = $(window).scrollTop();
241            if (scrollTop > (bodyHeight - dlHeight)) {
242                return false;
243            } else {
244                if (scrollTop > topHeight) {
245                    obj.stop().animate({ top: scrollTop + 500 });
246                } else {
247                    obj.stop().animate({ top: topHeight });
248                }
249            }
250        });
251        $("#goUp").click(function () {
252            $("html, body").animate({
253                scrollTop: 0
254            }, 1200);
255        });
256    }
257});
258
259window._bd_share_config = {
260    "common": {
261        "bdSnsKey": {},
262        "bdText": "",
263        "bdMini": "2",
264        "bdMiniList": ["tsina", "weixin", "sqq", "copy"],
265        "bdPic": "",
266        "bdStyle": "0",
267        "bdSize": "24"
268    }, "share": {}
269};
270with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];
271
272
273//解决无法进入12345白名单问题
274//$("a").each(function(){
275//    var url = $(this).attr("href");
276//     ip = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/;/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/;
277//    linkIp = ip.exec(url);
278//   if(linkIp != '111.21.38.68'){
279//    $(this).attr("rel","nofollow me noopener noreferrer")
280//    }
281//   })  
282//收藏
283function shoucang(sTitle, sURL) {
284    try {
285        window.external.addFavorite(sURL, sTitle);
286    }
287    catch (e) {
288        try {
289            window.sidebar.addPanel(sTitle, sURL, "");
290        }
291        catch (e) {
292            alert("加入收藏失败,请使用Ctrl+D进行添加");
293        }
294    }
295}
296
297
298
299
300
301
302

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.