1(function($){ 2 "use strict"; 3 4 // nav 5 (function($) { 6 var $nav = $('#main-nav'); 7 var $toggle = $('.toggle'); 8 var defaultData = { 9 maxWidth: false, 10 customToggle: $toggle, 11 navTitle: '<img src="//www.cnctst.cn/images/mcw2023-logo.png">', 12 labelClose: "å ³é", 13 levelTitles: true, 14 levelOpen:'expand', 15 levelSpacing:25 16 }; 17 var $clone = null; 18 var data = {}; 19 const initNav = function(conf) { 20 if ($clone) { 21 $clone.remove(); 22 } 23 $toggle.off('click'); 24 $clone = $nav.clone(); 25 $.extend(data, conf) 26 $clone.hcMobileNav($.extend({}, defaultData, data)); 27 } 28 initNav({}); 29 })(jQuery); 30 31 $(".nav-parent").each(function(){ 32 if($(this).find(".nav-wrapper").find("ul").find("a").length==0){ 33 $(this).find(".nav-next").remove(); 34 } 35 }) 36 37 $('.search-trigger').on('click', function(e){ 38 $('.up-search-box').addClass('active') 39 }); 40 41 $('.search-box').on('click', function(e){ 42 e.stopPropagation(); 43 }); 44 $('.up-close').on('click', function(e){ 45 $('.up-search-box').removeClass('active') 46 }); 47 48 // å¯¼èª 49 $(function(){ 50 $(".bread-item").find("span:last-child").remove(); 51 var len = ""; 52 var curChannel = $(".bread-item").find("a:eq(1)").text(); 53 var curChannelSub = $(".bread-item").find("a:eq(2)").text(); 54 var curChannelThree = $(".bread-item").find("a:last-child").html(); 55 $(".dropdown").each(function(){ 56 len = $(this).children(".dropdown-menu").children("li").length; 57 if(len<1){ 58 $(this).removeClass("dropdown"); 59 $(this).children(".dropdown-menu").remove(); 60 $(this).children("a").removeAttr("data-toggle").removeClass("dropdown-toggle"); 61 $(this).find("i").remove(); 62 $("a", this).off('click'); 63 $("a.dropdown-toggle", this).on('click', function (e) {}); 64 } 65 if($(this).children("a").text()==curChannel){ 66 $(this).addClass("active").siblings().removeClass('active'); 67 } 68 }); 69 70 //å³ä¾§ä¸çº§æ ç®é«äº®å¼å§ 71 $(".ny-right-title a").each(function(){ 72 var channelDesc=$(this).text().trim(); 73 if(channelDesc==curChannelThree){ 74 $(this).addClass("active").siblings().removeClass("active"); 75 } 76 }); 77 //å³ä¾§ä¸çº§æ ç®ç¹å»é«äº® 78 $(".ny-right-title a").click(function(){ 79 $(this).addClass("active").siblings().removeClass("active"); 80 }); 81 82 //å³ä¾§å级æ ç®é«äº®å¼å§ 83 $(".mcw-sub-menu a").each(function(){ 84 var channelDesc=$(this).text().trim(); 85 if(channelDesc==curChannelThree){ 86 $(this).addClass("active").siblings().removeClass("active"); 87 } 88 }); 89 //å³ä¾§å级æ ç®ç¹å»é«äº® 90 $(".mcw-sub-menu a").click(function(){ 91 $(this).addClass("active").siblings().removeClass("active"); 92 }); 93 }); 94 95 // LeftNav 96 $('.sub-menu').each(function(){ 97 $(this).click(function(){ 98 if($(this).hasClass('active')) { 99 $(this).removeClass('active') 100 } else { 101 $(this).addClass('active') 102 } 103 }) 104 }) 105 106 //å䏿»å¨æ¾ç¤ºè¿åé¡¶é¨ 107 $("#goTopBtn").click(function() { 108 var sc = $(window).scrollTop(); 109 $('body,html').animate({ 110 scrollTop: 0 111 }, 500); 112 }) 113 $(document).on("mousewheel DOMMouseScroll", function (e) { 114 // jq è·ådom äºä»¶å¯¹è±¡è¦éè¿originalEvent 115 var delta = (e.originalEvent.wheelDelta && (e.originalEvent.wheelDelta > 0 ? 1 : -1)) || 116 // chrome & ie 117 (e.originalEvent.detail && (e.originalEvent.detail > 0 ? -1 : 1)); // firefox 118 if (delta > 0) { 119 // å䏿» 120 if ($(window).scrollTop() >= 0) { 121 $("#goTopBtn").css("display", "block"); 122 } 123 } else if (delta < 0) { 124 // å䏿» 125 $("#goTopBtn").css("display", "none"); 126 } 127 }) 128 var touchStart, touchEnd, touchDiff = 80; 129 $(window).on({ 130 'touchstart': function (e) { 131 touchStart = e.originalEvent.changedTouches[0].clientY; 132 }, 133 'touchend': function (e) { 134 touchEnd = e.originalEvent.changedTouches[0].clientY; 135 var diff = touchStart - touchEnd; 136 if (diff >= touchDiff) { // direction down 137 $("#goTopBtn").css("display", "none"); 138 } else if (diff <= -touchDiff) { // direction up 139 if ($(window).scrollTop() >= 0) { 140 $("#goTopBtn").css("display", "block"); 141 } 142 } 143 } 144 }); 145})(jQuery);
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.