1$(function () { 2 // 第äºå±¤çtab-swiper 3 if ($(".main-tab-swiper").length > 0) { 4 var tab_swiper = new Swiper(".main-tab-swiper", { 5 slidesPerView: 'auto', 6 slidesPerGroup: 1, 7 }); 8 9 // å°æå®çslide 10 tab_swiper.slideTo($(".main-tab-swiper .active").index()); 11 12 //main-tab-swipe hover 13 $(document).on('mouseover', '.main-tab-swiper h3', function () { 14 handleTabChange($(this)); 15 }); 16 17 $(document).on('mouseout', '.main-tab-swiper h3', function () { 18 $(this).removeClass('hover-active'); 19 $('.tab-indicator').css({ 20 width: '0px', 21 }); 22 }); 23 24 // tabåç« 25 function handleTabChange(tab) { 26 $('.tab-indicator').css({ 27 width: tab.outerWidth(), 28 left: tab.position().left + parseInt(tab.css('marginLeft'), 10) 29 }); 30 tab.addClass('hover-active'); 31 tab.siblings().removeClass('hover-active'); 32 } 33 34 35 } 36 37 // application-swiper 38 if ($(".application-swiper").length > 0) { 39 var application_swiper = new Swiper(".application-swiper", { 40 slidesPerView: 'auto', 41 slidesPerGroup: 1, 42 navigation: { 43 nextEl: '.main-application-block .next-btn', 44 prevEl: '.main-application-block .pre-btn', 45 }, 46 }); 47 } 48 49 // related-swiper 50 if ($(".related-swiper").length > 0) { 51 var related_swiper = new Swiper(".related-swiper", { 52 slidesPerView: 'auto', 53 slidesPerGroup: 1, 54 navigation: { 55 nextEl: '.main-related-info-block .next-btn', 56 prevEl: '.main-related-info-block .pre-btn', 57 }, 58 }); 59 } 60 61 // è·³çªå½±ç 62 if ($('.popup-video').length > 0) { 63 $('.popup-video').magnificPopup({ 64 type: 'iframe', 65 closeOnBgClick: false, 66 //btnç¡æ³ç¨CSSè¦èæåæ¬Xçæ¨£å¼ 67 closeMarkup: '<button title="%title%" type="button" class="mfp-close"></button>', 68 callbacks: { 69 open: function () { 70 // .load使é®ç½©é±èï¼éæé®ç½©åå çºIOSå¨å½±çå°æªæ¥æ¾ææç ´ç 71 var iframe = document.getElementsByTagName("iframe")[0]; 72 doc = iframe.contentDocument || iframe.contentWindow; 73 if (doc.document) doc = doc.document; 74 75 if (iframe.getAttribute("src").indexOf("youtube") > -1) { 76 // youtubeå½±çç¡ç ´çåé¡ 77 $(".mfp-content").addClass("load"); 78 } else { 79 // <video>å¨IOSæç ´çåé¡ 80 $(".mfp-content").on("click", function () { 81 $(".mfp-content").addClass("load"); 82 }); 83 var _timer = setInterval(function () { 84 85 var video = iframe.contentWindow.document.getElementsByTagName("video")[0]; 86 // 使IOSå¯ä»¥èªåææ¾ 87 video.setAttribute("playsinline", ""); 88 video.setAttribute("mute", ""); 89 video.setAttribute("loop", ""); 90 video.play(); 91 if (video.currentTime > 0) { 92 $(".mfp-content").addClass("load"); 93 clearInterval(_timer); 94 } 95 }, 500); 96 } 97 } 98 } 99 }); 100 } 101 102 // åå°ææ¾å½±ç 103 $(".video:not(.popup-video)").click(function (e) { 104 if (!$(this).closest(".video-wrap").hasClass("play")) { 105 $(this).attr("controls", true); 106 $(this).closest(".video-wrap").addClass("play"); 107 videoControl(this) 108 } 109 });
110 111 function videoControl(video) { 112 //ç覽å¨å¨å½±çæ¥æ¾æï¼åæä¸æ¬¡æä½¿å½±çæ«åï¼æ æ¤èä¸åå¤å¯«æ«åçé輯 113 if (video.paused) { 114 video.play(); 115 } 116 } 117 118 119 //ç®åçè£ç½® 120 var now_device = getDevice(); 121 checkMore(); 122 123 //resize 124 $(window).resize(function () { 125 now_device = getDevice(); 126 checkMore(); 127 }); 128 129 //more-btn黿å¾å±éé±èçå §å®¹ 130 $(".more-btn").click(function () { 131 $(this).closest(".has-more-block").removeClass("more-unclicked"); 132 }); 133 134 //åå¾ç®åè£ç½® 135 function getDevice() { 136 var device = ""; 137 if (window.innerWidth > 1199) { 138 device = "pc"; 139 } else if (window.innerWidth > 767) { 140 device = "tb"; 141 } else { 142 device = "mb"; 143 } 144 return device; 145 } 146 147 //檢æ¥More Btnæ¯å¦éè¦åºç¾ 148 function checkMore() { 149 var more_btn_block = $(".more-btn-block"); 150 151 //ææ©ç以å¤è£ç½®ä¸é¡¯ç¤º 152 if (now_device == "mb") { 153 //ä¸ç¢ºå®æ¯å¦æå¯è½ä¸æ¬¡åºç¾å¤åmore-btnæ¼åä¸é ï¼æ ä»¥è¿´åæ¹å¼èç 154 more_btn_block.map(function () { 155 var this_btn_block = $(this); 156 //æå¤é¢çç¶å±¤ 157 var this_has_more_block = this_btn_block.closest(".has-more-block"); 158 159 // 夿·æ¯å¦å·²é»æémore-btn 160 if (!this_has_more_block.hasClass("more-unclicked")) { 161 // 已黿éï¼æéé±è 162 this_btn_block.addClass("hidden"); 163 } else { 164 165 // 夿·æ¯éå¶åºå®é«åº¦ï¼éæ¯åªç§ç¬¬ä¸ååé ç® 166 if (this_has_more_block.data('max-height') > 0) { 167 //è¦éå¶é«åº¦çå ç´ 168 var this_more_content = this_has_more_block.find(".more-content"); 169 170 var content_h = 0; 171 172 // æåé«åº¦å 總 173 this_more_content.map(function () { 174 content_h += $(this).prop("scrollHeight"); 175 }); 176 177 if (content_h > this_has_more_block.data('max-height')) { 178 //æªé»æéï¼ä¸å §å®¹è¶ édata-max-height 179 this_btn_block.removeClass("hidden"); 180 } 181 } else { 182 // åªç§ç¬¬ä¸ååé ç® 183 // 夿·æ¯å¦è¶ é1å以ä¸çé ç® 184 var content_count = this_has_more_block.find(".mb-show-1").children().length; 185 186 if (content_count > 1) { 187 //æªé»æéï¼ä¸åé ç®>1 188 this_btn_block.removeClass("hidden"); 189 } 190 } 191 } 192 193 194 }); 195 } else { 196 more_btn_block.addClass("hidden"); 197 } 198 } 199 200 // éåäºä»¶ 201 $(".open-close-item>.title").click(function () { 202 var this_item = $(this).closest(".open-close-item"); 203 this_item.toggleClass("open"); 204 this_item.find(".content").stop().slideToggle(); 205 }); 206 207 208 if ($(".main-sticky-block").length > 0 && !$(".main-sticky-block").hasClass('.tb-clear')) { 209 210 $("body").addClass("overflow-x-clear"); 211 } 212 213 214 215 stickyTbClear() 216 217$(window).on("resize",debounce(stickyTbClear)); 218 219 220 //left bar éå 221 if($('.left-bar-type').length > 0){ 222 if($('.left-bar-type .left-block > ul > li').hasClass('active')){ 223 $('.left-bar-type .left-block ul > li.active > ul').show(0) 224 } 225 226 $('.left-bar-type .left-block > ul > li.has-item').on('click',function(e){ 227 e.preventDefault(); 228 if($(this).hasClass('active')){ 229 $(this).removeClass('active') 230 $(this).find("ul").stop().slideUp("fast"); 231 }else{ 232 $(this).addClass('active') 233 $(this).find("ul").stop().slideDown("fast"); 234 } 235 }) 236 237 $('.left-bar-type .left-block ul > li').on('click',function(event){ 238 239 event.stopPropagation(); 240 }) 241 } 242}); 243
244function debounce(fn, delay = 1000) { 245 let timer; 246 return function () { 247 window.clearTimeout(timer); 248 timer = setTimeout(() => { 249 fn.apply(this, arguments); 250 window.clearTimeout(timer); 251 }, delay); 252 } 253} 254 255function stickyTbClear(){ 256 var screenWidth = $(window).width(); 257 if ($(".main-sticky-block").length > 0 && $(".main-sticky-block").hasClass('tb-clear')) { 258 if(screenWidth < 1199){ 259 $("body").removeClass("overflow-x-clear"); 260 }else{ 261 $("body").addClass("overflow-x-clear"); 262 } 263 264 } 265}
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.