1//å¾çæ°é» 2 var swiper01 = new Swiper('.xwdt_banner',{ 3 pagination: { 4 clickable: true, 5 el: '.xwdt_banner .swiper-pagination', 6 }, 7 loop: true, 8 autoplay: { 9 disableOnInteraction: false, //æå¨æ»å¨ä¹åä¸ææææ¾ 10 delay: 5000 11 }, 12 navigation: { 13 nextEl: ".swiper-button-next", 14 prevEl: ".swiper-button-prev", 15 }, 16 }); 17 $(function(){ 18//海丰æ°é»éé¡¹å¡ 19 $("#tab1").each(function(){ 20 var $tab = $(this); 21 var $lis = $tab.find("li"); 22 var swiperEle = $tab.next(".contten").find(".tab-swiper")[0]; 23 24 var tabSwiper = new Swiper(swiperEle, { 25 slidesPerView: 1, 26 spaceBetween: 0, 27 loop: false, 28 allowTouchMove: true, 29 speed: 300, 30 on: { 31 slideChange: function() { 32 var idx = this.activeIndex; 33 $lis.removeClass("selected"); 34 $lis.eq(idx).addClass("selected"); 35 } 36 } 37 }); 38 39 $lis.mouseover(function(){ 40 tabSwiper.slideTo( $(this).index() ); 41 }); 42 }); 43//æ¿å¡å ¬å¼éé¡¹å¡ 44 $("#tab2").each(function(){ 45 var $tab = $(this); 46 var $lis = $tab.find("li"); 47 var swiperEle = $tab.next(".contten").find(".tab-swiper")[0]; 48 49 var tabSwiper = new Swiper(swiperEle, { 50 slidesPerView: 1, 51 spaceBetween: 0, 52 loop: false, 53 allowTouchMove: true, 54 speed: 300, 55 on: { 56 slideChange: function() { 57 var idx = this.activeIndex; 58 $lis.removeClass("seles2"); 59 $lis.eq(idx).addClass("seles2"); 60 } 61 } 62 }); 63 64 $lis.mouseover(function(){ 65 tabSwiper.slideTo( $(this).index() ); 66 }); 67 }); 68 //äºå¨äº¤æµéé¡¹å¡ 69 $("#tab3").each(function(){ 70 var $tab = $(this); 71 var $lis = $tab.find("li"); 72 var swiperEle = $tab.next(".contten").find(".tab-swiper")[0]; 73 74 var tabSwiper = new Swiper(swiperEle, { 75 slidesPerView: 1, 76 spaceBetween: 0, 77 loop: false, 78 allowTouchMove: true, 79 speed: 300, 80 on: { 81 slideChange: function() { 82 var idx = this.activeIndex; 83 $lis.removeClass("seles2"); 84 $lis.eq(idx).addClass("seles2"); 85 } 86 } 87 }); 88 89 $lis.mouseover(function(){ 90 tabSwiper.slideTo( $(this).index() ); 91 }); 92 }); 93}); 94 95//æ¨ªå¹ 96 var swiper02 = new Swiper('.hftp', { 97 pagination: { 98 clickable: true, 99 el: '.hftp .swiper-pagination', 100 }, 101 loop: true, 102 }); 103 104//æå¡éé¡¹å¡ + 左峿»å¨å¨ç» 105$(function(){ 106 var $tab4 = $('.biaoti ul'); 107 var $lis = $tab4.find('li'); 108 var $products = $('.product'); 109 var $wrap = $('.product_wrap'); 110 var $line = $tab4.find('p'); 111 var len = $lis.length; 112 var currentIndex = 0; 113 var isAnimating = false; 114 // ç§»å¨åºé¨çº¿æ¡ 115 function setLine($item) { 116 var left = $item.position().left; 117 var width = $item.outerWidth(); 118 $line.stop(true).animate({ left: left, width: width }, 300); 119 } 120 // åå§å 121 $lis.first().addClass('onn'); 122 $products.eq(0).addClass('active'); 123 setLine($lis.first()); 124 125 // 忢颿¿ 126 function switchTab(idx, dir){ 127 if(idx < 0 || idx >= len || isAnimating) return; 128 isAnimating = true; 129 var prevIndex = currentIndex; 130 currentIndex = idx; 131 132 var $curLi = $lis.eq(idx); 133 var $prevProduct = $products.eq(prevIndex); 134 var $nextProduct = $products.eq(idx); 135 136 // 忢éä¸ç±» 137 $lis.removeClass('onn'); 138 $curLi.addClass('onn'); 139 140 // 左峿»å¨å¨ç» 141 if(dir === 'left'){ 142 $prevProduct.removeClass('active leave-right').addClass('leave-left'); 143 $nextProduct.removeClass('leave-left leave-right').addClass('active'); 144 }else{ 145 $prevProduct.removeClass('active leave-left').addClass('leave-right'); 146 $nextProduct.removeClass('leave-left leave-right').addClass('active'); 147 } 148 149 setLine($curLi); 150 151 setTimeout(function(){ 152 isAnimating = false; 153 }, 300); 154 } 155 156 // çµèé¼ æ ç§»å ¥ 157 $lis.mouseenter(function(){ 158 var index = $lis.index($(this)); 159 var dir = index > currentIndex ? 'left' : 'right'; 160 switchTab(index, dir); 161 });
162 163 // ææºè§¦æ¸æ»å¨ 164 var startX = 0, moveX = 0; 165 $wrap.on('touchstart', function(e){ 166 startX = e.originalEvent.touches[0].clientX; 167 }); 168 $wrap.on('touchmove', function(e){ 169 moveX = e.originalEvent.touches[0].clientX; 170 }); 171 $wrap.on('touchend', function(){ 172 var diff = startX - moveX; 173 if(Math.abs(diff) > 30){ 174 if(diff > 0){ 175 switchTab(currentIndex + 1, 'left'); 176 }else{ 177 switchTab(currentIndex - 1, 'right'); 178 } 179 } 180 startX = moveX = 0; 181 }); 182}); 183//æ¿æ°äºå¨è½®æå¾ 184$(document).ready(function(){ 185 var $dotLi = $('.baninf_dot li'); 186 var $titleLi = $('.baninf_title li'); 187 var swiperEle = document.querySelector('.banner-swiper'); 188 189 // åå§åSwiper 190 var bannerSwiper = new Swiper(swiperEle, { 191 slidesPerView: 1, 192 spaceBetween: 0, 193 loop: true, // 循ç¯è½®æ 194 autoplay: { 195 delay: 5000, // 5ç§åæ¢ï¼åå代ç ä¸è´ 196 disableOnInteraction: false 197 }, 198 speed: 300, 199 allowTouchMove: true, 200 201 // 忢æ¶åæ¥åç¹ + æ é¢å¨ç» 202 on: { 203 slideChange: function(){ 204 var idx = this.realIndex; // è·åçå®ç´¢å¼ï¼æé¤loopå¤å¶é¡¹ï¼ 205 // åç¹åæ¢ 206 $dotLi.removeClass('baninf_ondot'); 207 $dotLi.eq(idx).addClass('baninf_ondot'); 208 209 // æ é¢å¨ç»ï¼ååé»è¾ä¸è´ï¼ 210 $titleLi.hide().css('width','0'); 211 $titleLi.eq(idx).show().stop().animate({width:'290px'}, 200); 212 } 213 } 214 }); 215 216 // é¼ æ hover åç¹ â åæ¢è½®æ 217 $dotLi.hover(function(){ 218 var index = $(this).index(); 219 bannerSwiper.slideToLoop(index); 220 }); 221 222 // é¼ æ è¿å ¥banneråºå æåè½®æ 223 $('#banimg').hover(function(){ 224 bannerSwiper.autoplay.stop(); 225 },function(){ 226 bannerSwiper.autoplay.start(); 227 }); 228}); 229//ä¸é¢ä¸æ 230 var swiper = new Swiper('.ztzl_con', { 231 slidesPerView: 4, 232 spaceBetween: 15, 233 loop: true, 234 autoplay: { 235 disableOnInteraction: false, //æå¨æ»å¨ä¹åä¸ææææ¾ 236 delay: 5000 237 }, 238 navigation: { 239 nextEl: '.swiper-button-next', 240 prevEl: '.swiper-button-prev', 241 }, 242 243 }); 244 // çå¬çªå£ååï¼ææºç«¯è°æ´æ¾ç¤ºæ°é 245function setSwiperView() { 246 var winW = $(window).width(); 247 if (winW <= 768) { // ææº/å¹³æ¿æç¹ï¼å¯èªè¡ä¿®æ¹ 248 swiper.params.slidesPerView = 2; // ææºç«¯æ¾ç¤º2å¼ ï¼åå¼ å æ¯æ´å¤§=è§è§æ¾å¤§ 249 swiper.params.spaceBetween = 10; // ææºç«¯ç¼©å°é´è· 250 } else { 251 swiper.params.slidesPerView = 4; // 大屿¢å¤4å¼ 252 swiper.params.spaceBetween = 15; 253 } 254 swiper.update(); // å·æ°è½®æå¸å± 255} 256 257// åå§åæ§è¡ä¸æ¬¡ 258setSwiperView(); 259// çªå£ç¼©æ¾å®æ¶æ§è¡ 260$(window).resize(function(){ 261 setSwiperView(); 262});
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.