PageSourceSearch

https://dongning.gov.cn/mdjdnsrmzf/xhtml/pc2023/js/header.js

js dongning.gov.cn collected 2026-10-02 16:47:42 UTC 3,483 bytes, 116 lines download raw bytes

1$(function(){
2
3
4// 图片损坏替换默认图片
5$(".home-tpxw .js-slideTpxw .item img,.xwzx-tpxw  .js-slideTpxw .item img").each(function(){
6  var _src = $(this).attr('src');
7  if(_src == '' || _src == '/null'){
8    $(this).attr('src','/default/xhtml/static/images/tb_default.jpg'); //替换损坏的图片
9  }
10})
11
12    /** 导航选中效果 S */ 
13    try {
14        var str = $('.crumb').text();
15        var str1 = str.split('>')[1];
16        if (str1 && $.trim(str1) != '') {
17            $('.mainnav ul li').each(function () {
18                if ($.trim($(this).find('a').text()).search($.trim(str1)) > -1) {
19                    $(this).addClass('on').siblings().removeClass('on');
20                }
21            });
22        }else{
23            $('.mainnav ul li').eq(0).addClass('on');
24        }
25    } catch (e) {}
26    /** 导航选中效果 E */ 
27
28    /** 移动端导航 S */ 
29    $("#header-toggle-btn").click(function (e) {
30      $("body").toggleClass("openDrawer");
31      e.stopPropagation();
32    });
33  
34    $("#header_drawer").click(function (e) {
35      e.stopPropagation();
36    });
37    /** 移动端导航 E */ 
38
39    /** 固定导航 S */
40    var fixedMainnavFun = {
41      scroll: function scroll() {
42        var _this = this, header = $('.header'), $mainnav = $('.mainnav');
43        var headerMt = header.offset().top + header.height() - 75;
44    
45        setFixed();
46    
47        $(window).scroll(function (event) {
48          _this.debounce(function(){
49            setFixed();
50          }, 100);
51        });
52    
53        function setFixed(){
54          var top = $(window).scrollTop();
55            if (top > headerMt) {
56              if (!$mainnav.hasClass('fixed')) {
57                $mainnav.addClass('fixed');
58                $(".header-toggle-btn").addClass('fixed');
59              }
60            } else {
61              if ($mainnav.hasClass('fixed')) {
62                $mainnav.removeClass('fixed');
63                $(".header-toggle-btn").removeClass('fixed');
64              }
65            }
66        }
67      },
68      debounce: function debounce(fn, wait) {
69        var _this = this;
70        if (!_this.timeout) {
71          _this.timeout = setTimeout(function () {
72            fn.apply();
73            _this.timeout = null;
74          }, wait);
75        }
76      },
77    }
78    fixedMainnavFun.scroll();
79    
80    /** 固定导航 E */
81    
82
83    /** 站内搜索 S */ 
84    $('#header-search-btn').click(function () {
85        var keyword = $.trim($('#header-search-keywords').val());
86        var SiteIDCode=$('meta[name="SiteIDCode"]').attr('content') || $('#header-search-form input[name="siteCode"]').val();
87        if(keyword == '') {
88            alert("请输入您要搜索的内容");
89            $('#header-search-keywords').focus();
90        } else {
91            //   $('#header-search-form').submit();
92            window.open('/search5/html/searchResult_mudanjiang.html?siteCode='+SiteIDCode+'&searchWord='+keyword ,'_blank');
93        }
94    });
95
96    $('#header-search-keywords').bind('focus',function(){
97        $(this).val('');
98    });
99
100    $('#header-search-keywords').bind('keypress', function (event) {
101        if (event.keyCode == '13') {
102            $('#header-search-btn').click();
103            return false;
104        }
105    });
106    /** 站内搜索 E */ 
107
108
109        // 政策库
110$('.policysearch').on('click', function () {
111    var keyword = $.trim($('#keyword-zc').val());
112    window.open('/' + websiteCode + '/policy/policy.shtml?searchword=' + keyword);
113  })
114});
115
116

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.