PageSourceSearch

https://www.ks.gov.cn/kss/xhtml/2022/js/common.js

js ks.gov.cn collected 2026-10-02 16:41:04 UTC 5,615 bytes, 175 lines download raw bytes

1$(document).ready(function () {
2    $("title").after("<link rel='Shortcut Icon' href='/kss/xhtml/images/favicon.ico' type='image/x-icon'/>");
3    //选项卡
4    if ($(".js-tab").length > 0) {
5        jQuery(".js-tab").slide({
6            delayTime: 0,
7            triggerTime: 0,
8            targetCell: ".more a"
9        });
10    }
11
12    if ($(".js-tab-hs").length > 0) {
13        jQuery(".js-tab-hs").slide({
14            titCell: ".hd li.hs",
15            mainCell: ".bd",
16            delayTime: 0,
17            triggerTime: 0,
18            targetCell: ".more a"
19        });
20    }
21
22    if ($(".js-outTab").length > 0) {
23        jQuery(".js-outTab").slide({
24            titCell: ".js-outHd ul li",
25            mainCell: ".js-outBd",
26            effect: "fade",
27            pnLoop: false
28        });
29    }
30
31    // 轮播通用配置
32    var owlConfig = {
33        items: 1,
34        loop: true,
35        autoplay: true,
36        smartSpeed: 800,
37        autoplayTimeout: 5000,
38        responsiveClass: true,
39        autoplayHoverPause: true,
40        autoHeight: true
41    };
42
43    // 图片新闻轮播
44    if ($(".js-slideTpxw").length > 0) {
45        $(".js-slideTpxw").owlCarousel($.extend(owlConfig, {
46            nav: false,
47            // navText: ['<i></i>', '<i></i>'],
48            dots: true
49        }));
50    }
51
52    if ($(".js2-slideTpxw").length > 0) {
53        $(".js2-slideTpxw").owlCarousel($.extend(owlConfig, {
54            nav: false,
55            dots: true
56        }));
57    }
58
59    // 专题专栏轮播
60    if ($(".js-scrollZtzl").length > 0) {
61        $(".js-scrollZtzl").owlCarousel({
62            loop: true,
63            autoplay: true,
64            nav: true,
65            navText: ['<i></i>', '<i></i>'],
66            responsive: {
67                0: {
68                    items: 1,
69                    margin: 0
70                },
71                414: {
72                    items: 2,
73                    margin: 20
74                },
75                640: {
76                    items: 2,
77                    margin: 30
78                },
79                992: {
80                    items: 3,
81                    margin: 30
82                },
83                1024: {
84                    items: 4,
85                    margin: 30
86                }
87            }
88        });
89    }
90
91    //友情链接
92    var $links = $('.footer-links .hd li.hs');
93    $links.click(function (e) {
94        var index = $links.index(this);
95        $(this).toggleClass("on").siblings().removeClass("on");
96        $(".footer-links .bd ul").eq(index).slideDown("fast").siblings().slideUp("fast");
97        if (!$(this).hasClass('on')) {
98            $(".footer-links .bd ul").eq(index).slideUp("fast");
99        }
100        e.preventDefault();
101        e.stopPropagation();
102    })
103    $(document).click(function () {
104        $links.removeClass("on");
105        $(".footer-links .bd ul").slideUp("fast");
106    })
107
108    //非政府网站跳转提示
109    //点击外链询问离开
110    //截取URL域名部份
111    var getHost = function (url) {
112        var host = "null";
113        if (typeof url == "undefined" || null == url) url = window.location.href;
114        var regex = /.*\:\/\/([^\/]*).*/;
115        var match = url.match(regex);
116        if (typeof match != "undefined" && null != match) host = match[1];
117        return host;
118    };
119    //外链跳转弹框
120    _outHtml = '<div class="alert-warning"><div class="alert-delete"><span id="closets">X</span></div><div class="alert-wzsm"><P>您即将访问非政府网站链接,是否继续?</P></div><div class="alert-footer"><span class="continue">继续访问</span><span class="fangqi">放弃</span></div></div><div class="alert-mengban"></div>', $("body").append(_outHtml);
121
122    $(document).on('click', 'a', function (e) {
123        if ($(this).hasClass('selflink')) return;
124        var o = $(this),
125            host, ckhost;
126        var href = o.attr('href');
127        if (href && !/^(?=javascript:)/.test(href) && /^(?=http)/.test(href)) {
128            host = getHost(href);
129            ckhost = host.indexOf('gov.cn');
130        }
131        if (href && host) {
132            if (host != document.domain) {
133                o.attr('target', '_blank');
134                if (host == 'tian.ks.cn:8888') return;
135                if (ckhost <= 0 && o.data('ask') != '1') {
136                    $(".alert-mengban").fadeIn("fast");
137                    $(".alert-warning").fadeIn("fast");
138                    $("#closets,.fangqi, .alert-mengban").click(function () {
139                        $(".alert-warning").fadeOut(300);
140                        $(".alert-mengban").fadeOut(300);
141                    });
142                    $(".continue").one("click", function () {
143                        $(".alert-warning").fadeOut(300);
144                        $(".alert-mengban").fadeOut(200);
145                        o.data('ask', '1');
146                        o[0].click();
147                        $("#closets").click();
148                    });
149                    return false;
150                }
151            }
152        }
153    });
154
155});
156
157
158//截取网址参数
159function getUrlParam(name) {
160	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); // 构造一个含有目标参数的正则表达式对象
161	var r = window.location.search.substr(1).match(reg); // 匹配目标参数
162	if (r != null)
163		return unescape(r[2]);
164	return ''; // 返回参数值
165}
166
167
168//百度统计
169var _hmt = _hmt || [];
170(function() {
171  var hm = document.createElement("script");
172  hm.src = "https://hm.baidu.com/hm.js?80972d956ce6b47981d2185f70da576e";
173  var s = document.getElementsByTagName("script")[0]; 
174  s.parentNode.insertBefore(hm, s);
175})();

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.