// 婊氬姩鏉$洃鍚簨浠 鐢ㄤ簬婊氬姩鐗规晥婊氬姩 // let scrollGun = true; // $(window).scroll(function(){//寮€濮嬬洃鍚粴鍔ㄦ潯 // //鑾峰彇褰撳墠婊氬姩鏉¢珮搴 // let topp = $(document).scrollTop(); // if(topp>300 && scrollGun){ // // 璋冪敤鏁板瓧婊氬姩鍑芥暟 // // numScroll('chuangli',1999,2000); // numScroll('yuangong',$('#yuangong').text(),2000); // numScroll('zhuanli',$('#zhuanli').text(),2000); // numScroll('huojiang',$('#huojiang').text(),2000); // numScroll('gongsi',$('#gongsi').text(),2000); // scrollGun = false; // } // }); // 椤靛ご鎼滅储妗嗙偣鍑讳簨浠 $(".header_search_box .shanchu").click(function(){ $(".header_search_box input").val(""); }) let shou = true; $(".header_search .search").click(function(){ if(shou){ $(".header_search .search img").attr("src","/template/default/images/index/tou/sousuo.png"); $(".header_search .search img").css("width","25%"); $(".header_search .search").addClass("search_cha"); $(".header_search_box").stop().slideDown(300,function(){ $(".header_search_box").css("display","block"); }) shou = false; }else{ $(".header_search .search").removeClass("search_cha"); $(".header_search .search img").attr("src","/template/default/images/index/top/search2.png"); $(".header_search .search img").css("width","100%"); $(".header_search_box").stop().slideUp(300,function(){ $(".header_search_box").css("display","none"); $(".header_search_box input").val(""); }) shou = true; } }) // 椤靛ご闈㈠寘灞戜笅婊 let bol = true; $(".header_menu").click(function(){ if(bol){ $(".header_nav").stop().slideDown(300,function(){ $(".header_nav").css("display","block"); }); bol = false; }else{ $(".header_nav").stop().slideUp(300,function(){ $(".header_nav").css("display","none"); }); bol = true; } }); // 椤靛ご浜屾鑿滃崟 $(".header_nav>li").mouseenter(function(){ $($(this)[0].children[1]).stop().slideDown(300); }); $(".header_nav>li").mouseleave(function(){ $($(this)[0].children[1]).stop().slideUp(300); }); // 椤靛ご杞挱鍥 let swiper1 = new Swiper('#swiper1',{ // grabCursor : true,// 瑙︽懜鍙樻垚鎵嬫帉 autoplay: 2000, speed:1000, // 閫熷害 loop : true, // 璁㏒wiper鐪嬭捣鏉ユ槸寰幆鐨 pagination : '.swiper-pagination', paginationClickable :true, }); //榧犳爣瑕嗙洊鍋滄鑷姩鍒囨崲 $("#swiper1").mouseenter(function(){ swiper1.stopAutoplay(); }); //榧犳爣绂诲紑寮€濮嬭嚜鍔ㄥ垏鎹 $("#swiper1").mouseleave(function(){ swiper1.startAutoplay(); }); // 浜у搧鏂规杞挱鍥 var sw1Swiper = new Swiper('.sw1 .swiper-container', { autoplay: 2400,speed: 800,autoplayDisableOnInteraction: false, prevButton: '.sw1 #swiper-button1',nextButton: '.sw1 #swiper-button2', slidesPerView: 4,spaceBetween: 4, breakpoints: { 480: { slidesPerView: 1,spaceBetween: 10},640: {slidesPerView: 2,spaceBetween: 10},1000: {slidesPerView: 3,spaceBetween: 10}} }); $(".sw1").mouseenter(function(){sw1Swiper.stopAutoplay();}); $(".sw1").mouseleave(function(){sw1Swiper.startAutoplay();}); var sw2Swiper = new Swiper('.sw2 .swiper-container', { autoplay: 2400,speed: 800,autoplayDisableOnInteraction: false, prevButton: '.sw2 #swiper-button1',nextButton: '.sw2 #swiper-button2', slidesPerView: 4,spaceBetween: 4, breakpoints: { 480: { slidesPerView: 1,spaceBetween: 10},640: {slidesPerView: 2,spaceBetween: 10},1000: {slidesPerView: 3,spaceBetween: 10}} }); $(".sw2").mouseenter(function(){sw2Swiper.stopAutoplay();}); $(".sw2").mouseleave(function(){sw2Swiper.startAutoplay();}); var sw3Swiper = new Swiper('.sw3 .swiper-container', { autoplay: 2400,speed: 800,autoplayDisableOnInteraction: false, prevButton: '.sw3 #swiper-button1',nextButton: '.sw3 #swiper-button2', slidesPerView: 4,spaceBetween: 4, breakpoints: { 480: { slidesPerView: 1,spaceBetween: 10},640: {slidesPerView: 2,spaceBetween: 10},1000: {slidesPerView: 3,spaceBetween: 10}} }); $(".sw3").mouseenter(function(){sw3Swiper.stopAutoplay();}); $(".sw3").mouseleave(function(){sw3Swiper.startAutoplay();}); var sw4Swiper = new Swiper('.sw4 .swiper-container', { autoplay: 2400,speed: 800,autoplayDisableOnInteraction: false, prevButton: '.sw4 #swiper-button1',nextButton: '.sw4 #swiper-button2', slidesPerView: 4,spaceBetween: 4, breakpoints: { 480: { slidesPerView: 1,spaceBetween: 10},640: {slidesPerView: 2,spaceBetween: 10},1000: {slidesPerView: 3,spaceBetween: 10}} }); $(".sw4").mouseenter(function(){sw4Swiper.stopAutoplay();}); $(".sw4").mouseleave(function(){sw4Swiper.startAutoplay();}); var sw5Swiper = new Swiper('.sw5 .swiper-container', { autoplay: 2400,speed: 800,autoplayDisableOnInteraction: false, prevButton: '.sw5 #swiper-button1',nextButton: '.sw5 #swiper-button2', slidesPerView: 4,spaceBetween: 4, breakpoints: { 480: { slidesPerView: 1,spaceBetween: 10},640: {slidesPerView: 2,spaceBetween: 10},1000: {slidesPerView: 3,spaceBetween: 10}} }); $(".sw5").mouseenter(function(){sw5Swiper.stopAutoplay();}); $(".sw5").mouseleave(function(){sw5Swiper.startAutoplay();}); // $(".product-item .swiper-container").each(function(){ // $(this).swiper({ // nextButton: $('#swiper-button2',this), // prevButton: $('#swiper-button1',this), // observer:true, // observeParents:true, // autoplay: 3600, // slidesPerView: 4, // 榛樿涓€娆″睍绀?寮犲浘鐗 // spaceBetween: 4, // 杞挱鍥鹃棿闅 // breakpoints: { // //褰撳搴﹀皬浜庣瓑浜?80 // 480: { // slidesPerView: 1, // spaceBetween: 10 // }, // //褰撳搴﹀皬浜庣瓑浜?40 // 640: { // slidesPerView: 2, // spaceBetween: 10 // }, // 1000: { // slidesPerView: 3, // spaceBetween: 10 // } // } // }); // }); // 琛屼笟搴旂敤杞挱鍥 let swiper3 = new Swiper('#swiper3',{ slidesPerView : 3, // 涓€娆″睍绀?寮犲浘鐗 spaceBetween : 8, // 杞挱鍥鹃棿闅 nextButton: '#swiper-button4', prevButton: '#swiper-button3', breakpoints: { //褰撳搴﹀皬浜庣瓑浜?80 640: { slidesPerView: 1, spaceBetween: 5 }, 1000: { slidesPerView: 2, spaceBetween: 5 } } }); $(".yqlj").mouseenter(function(){ $(".yqlj-box").show(); }) $(".yqlj").mouseleave(function(){ $(".yqlj-box").hide(); }) // 婊氬姩鐗规晥灏佽浠g爜 /* id: 闇€瑕佹粴鍔ㄧ殑鑺傜偣鐩掑瓙 maxNum: 闇€瑕佹粴鍔ㄥ埌鐨勬暟瀛 time锛 婊氬姩鍔ㄧ敾瀹屾垚鎵€闇€鏃堕棿 */ function numScroll(id, maxNum, time) { let numDom = document.getElementById(id); // 鑾峰彇鑺傜偣 let numInit = 0; // 鍒濆鍊 浠?寮€濮 let addNum = maxNum / (time / 10); // 婊氬姩閫熷害 let t = setInterval(function() { if (numInit >= maxNum) { clearInterval(t); // 鍏抽棴瀹氭椂鍣 if(maxNum < 10){ numDom.innerText = maxNum; // 灏嗚妭鐐瑰唴瀹规敼鍙樻垚浼犲弬鍊 }else{ numDom.innerText = maxNum; // 灏嗚妭鐐瑰唴瀹规敼鍙樻垚浼犲弬鍊 } } else { if(maxNum < 10){ // 褰撳墠鏁板€煎皬浜?0 鍒?琛ヤ綅 numInit += addNum; numDom.innerText = "0" + Math.round(numInit); //鍔ㄦ€佹敼鍙樻暟鎹 }else{ numInit += addNum; numDom.innerText = Math.round(numInit); //鍔ㄦ€佹敼鍙樻暟鎹 } } }, 10) } // 杞挱鍥惧垎椤靛垏鎹 鍙 鎸夐挳鍒囨崲 $(".container_chanpin ul li button").click(function(){ let num = 0; if($(this)[0].name == "button1"){ num = 0; }else if($(this)[0].name == "button2"){ num = 1; }else if($(this)[0].name == "button3"){ num = 2; }else if($(this)[0].name == "button4"){ num = 3; }else if($(this)[0].name == "button5"){ num = 4; }else if($(this)[0].name == "button6"){ num = 5; } // 娓呯┖鎵€鏈夋寜閽彉鑹 $(".container_chanpin ul li button").css({ "color":"#000", "background":"#f7f7f7", "border":"2px solid #e4e4e4" }) // 褰撳墠鐐瑰嚮閫夐」鍙樿壊 $(this).css({ "color":"#dfedf7", "background":"#0f76c5", "border":"none" }); // 闅愯棌鎵€鏈夎疆鎾浘 $(".product-item").removeClass("on"); // 鏄剧ず褰撳墠杞挱鍥 if(num == 0){ $(".product-item-container .product-item:eq(0)").addClass("on"); }else if(num == 1){ $(".product-item-container .product-item:eq(1)").addClass("on"); }else if(num == 2){ $(".product-item-container .product-item:eq(2)").addClass("on"); }else if(num == 3){ $(".product-item-container .product-item:eq(3)").addClass("on"); }else if(num == 4){ $(".product-item-container .product-item:eq(4)").addClass("on"); }else if(num == 5){ $(".product-item-container .product-item:eq(5)").addClass("on"); } }) // 鏃堕棿杞 var p = $('.abolc-dot').width(), n = -50; $(".abolc-ldot .abolc-dotline").css("left",p + "px"); $(".abolc-rdot .abolc-dotline").css("left",n + "px"); var timerShaft = new Swiper('.abolc-time .swiper-container', { speed: 400, slidesPerView: 1, slidesPerGroup : 1, spaceBetween : 0, centeredSlides: true, slideToClickedSlide:true, prevButton: '.abolc-prev', nextButton: '.abolc-next', onSlideChangeStart: function(swiper){ comTeamMove(swiper.activeIndex,timerShaft,timerWords); } }); $(".abolc-ldot .abolc-dotck").bind("click",function(){timerShaft.slideTo($(this).index())}); $(".abolc-rdot .abolc-dotck").bind("click",function(){timerShaft.slideTo($(this).index())}); function comTeamMove(index,timerShaft,timerWords){ $(".abolc-ldot .abolc-dotline").stop().animate({left: (3 - index) * 50}, 300); $(".abolc-rdot .abolc-dotline").stop().animate({left: (-1 - index) * 50}, 300); if($(window).width()<1000){ $(".abolc-ldot .abolc-dotline").stop().animate({left: (2 - index) * 50}, 300); $(".abolc-rdot .abolc-dotline").stop().animate({left: (-1 - index) * 50}, 300); } if($(window).width()<640){ $(".abolc-ldot .abolc-dotline").stop().animate({left: (1 - index) * 50}, 300); $(".abolc-rdot .abolc-dotline").stop().animate({left: (-1 - index) * 50}, 300); } timerWords.slideTo(index);timerShaft.slideTo(index); } var timerWords = new Swiper('.abolc-wdbox .swiper-container', {speed: 0}); // over // 缃《 $(".sideBar-wrapper .backTop").click(function () { $("html,body").animate({ scrollTop: "0px" }, 800) }); // 椤甸潰body 娣诲姞绫诲悕 鐩戝惉浜嬩欢 bodyChange(); function bodyChange(){ if ($(window).width() <= 1000) {$("body").removeClass("winter");}else{$("body").addClass("winter");} } widthChange(); function widthChange(){ var window_width = $(window).width();//鑾峰彇娴忚鍣ㄧ獥鍙e搴 // 瓒呭嚭璁惧鎻愮ず if (!!window.ActiveXObject || "ActiveXObject" in window){return false;} var rberMe = sessionStorage['rberMe'] || ''; if( window_width >= 2000 && rberMe==''){ sessionStorage['rberMe'] = 'www.yisiy.com'; var wthint = "鎮ㄧ殑鏄剧ず璁惧宸茶秴鍑鸿璁¤寖鍥达紒涓轰簡甯冨眬缇庤锛岄噰鍙栧眳涓帓鐗堬紒纭畾鍚楋紵"; if (window.confirm(wthint)) {sessionStorage['rberMe'] = 'winter';$("body").addClass("body-maxwidth");} else{return;} } if(rberMe=='winter') {$("body").addClass("body-maxwidth");} } // 鍒ゆ柇鏄惁涓篒E娴忚鍣 // if (!!window.ActiveXObject || "ActiveXObject" in window){alert("褰撳墠涓篒E娴忚鍣紝閮ㄥ垎鏁堟灉鍜屾牱寮忎笉鍏煎锛佽鏇存崲娴忚鍣紝娆h祻鏇翠匠锛?);} //娴忚鍣ㄧ獥鍙d簨浠 $(window).resize(function () {widthChange();bodyChange();});