// banner function initBannerSlider() { // 如果已有实例,先销毁 if (typeof swiper !== 'undefined' && swiper.destroy) { swiper.destroy(true, true); } var gw = $(window).width(); var baVideo = $(".banner .vde"); // 根据屏幕宽度决定是否保留视频slide if (baVideo.length != 0) { if (gw <= 1024) { $('.swiper-slide.vde').remove(); } else {// 如果是在桌面端且之前删除过视频slide,可能需要重新添加 // 这里假设原始HTML中有视频slide } } // 重新初始化Swiper swiper = new Swiper(".main-visual-slider .swiper-container",{ loop: true, speed: 1200, observer: true, observeParents: true, autoplay: { delay: 6000, disableOnInteraction: false }, pagination: { el: '.banner .swiper-pagination', clickable: true, bulletActiveClass: 'on', }, navigation: { nextEl: '.banner .swiper-button-next', prevEl: '.banner .swiper-button-prev', }, on: { slideChangeTransitionStart: function(swiper) { var swiper = this; if ($(".main-visual-slider .swiper-slide-active video").length > 0) { console.log(1) swiper.autoplay.stop(); setTimeout(function() { swiper.autoplay.stop(); $(".main-visual-slider .swiper-slide-active video").attr("id", "video_01"); var _video = document.getElementById("video_01"); _video.play(); _video.currentTime = 0; _video.volume = 0; _video.addEventListener('ended', function() { swiper.slideNext(); swiper.autoplay.start(); }); }, 10); } }, slideChangeTransitionEnd: function(swiper) { setTimeout(function() { $(".main-visual-slider .swiper-slide-active video").attr("id", ""); }, 10); }, } }); } // 初始化 initBannerSlider(); // 监听窗口大小变化 $(window).on('resize', function() { clearTimeout(window.swiperResizeTimer); window.swiperResizeTimer = setTimeout(function() { initBannerSlider(); }, 250); }); // $(function () { // // //切换轮播1 // $(".home2 .title h3").click(function (e) { // e.preventDefault() // $(this).addClass('on').siblings().removeClass('on') // var i = $(this).index(); // $(".home2 .title a").eq(i).addClass('on').siblings().removeClass('on'); // // $(".home2 .tab1").eq(i).slideDown().siblings().slideUp(); // tab1.slideTo($(this).index()) // }); // var tab1 = new Swiper('.home2-t>.swiper-container', { // noSwiping: true, // speed: 800, // slidesPerView: 1, // effect: "fade", // fadeEffect: { // crossFade: true, // }, // on: { // slideChangeTransitionStart: function () { // $(".home2 .title h3").eq(this.realIndex).addClass('on').siblings().removeClass('on'); // $(".home2 .title .a").eq(this.realIndex).addClass('on').siblings().removeClass('on'); // } // } // }); // }); $(".home1-t .right li").mouseenter(function () { $(this).addClass('on').siblings().removeClass('on'); }) $(".h7-t dt").click(function () { var i = $(this).index(); $(this).addClass('on').siblings().removeClass('on'); $(".home7 .tab").eq(i).stop().addClass("on").siblings().removeClass("on"); }) $(".home7 .tab li").click(function () { var i = $(this).index(); $(this).addClass('on').siblings().removeClass('on'); $(".home7 .tab2").eq(i).stop().fadeIn().siblings().hide(); }) var swiper1 = new Swiper('.home1 .swiper-container', { speed: 1000, loop: true, slidesToShow: 1, autoplay: { delay: 4000, stopOnLastSlide: false, disableOnInteraction: false, }, // 如果需要前进后退按钮 pagination: { el: '.home1 .swiper-pagination', clickable: true, // bulletActiveClass: 'on', }, navigation: { nextEl: '.home1 .swiper-button-next', prevEl: '.home1 .swiper-button-prev', } }) var new4t = new Swiper('.home4-t .swiper-container', { // loop: true, speed: 1000, // autoplay: { // delay: 6000, // stopOnLastSlide: false, // disableOnInteraction: false, // }, observer:true, observeParents:true, watchSlidesVisibility: true, navigation: { nextEl: '.home4-t .swiper-button-next', prevEl: '.home4-t .swiper-button-prev', }, pagination: { el: '.home4-t .swiper-pagination', clickable: true, }, breakpoints: { 320: { slidesPerView: 3, spaceBetween: 10, }, 420: { slidesPerView: 4, spaceBetween: 10, }, 600: { slidesPerView: 5, spaceBetween: 10, }, 768: { slidesPerView: 8, spaceBetween: 10, }, 1024: { slidesPerView: 12, spaceBetween: 0, // loopedSlides: 12, }, }, }) $(".home4-t li").click(function (e) { e.preventDefault() $(this).addClass('on').siblings().removeClass('on') var i = $(this).index(); // $(".home2 .tab1").eq(i).slideDown().siblings().slideUp(); // swiper4.slideTo(i) }); var new4b = new Swiper('.home4-b .swiper-container', { speed: 1000, // loop: true, slidesToShow: 1, autoplay: { delay: 8000, stopOnLastSlide: false, disableOnInteraction: false, }, observer:true, observeParents:true, pagination: { el: '.home4-b .swiper-pagination', clickable: true, bulletActiveClass: 'on', }, navigation: { nextEl: '.home4-b .swiper-button-next', prevEl: '.home4-b .swiper-button-prev', }, thumbs: { swiper: new4t, }, on: { slideChangeTransitionStart: function () { $(".home4-t li").eq(this.realIndex).addClass('on').siblings().removeClass('on'); } }, breakpoints: { 320: { slidesPerView: 1, spaceBetween: 0, }, 1024: { slidesPerView: 1, spaceBetween: 70, // loopedSlides: 12, }, }, }) // new4t.controller.control = new4b;//Swiper1控制Swiper2,需要在Swiper2初始化后 // new4b.controller.control = new4t; $('.home3-slick').slick({ // slidesToShow: 1, slidesToScroll: 1, arrows: false, dots: true, autoplay: false, rows: 2, slidesPerRow: 3, responsive: [ { breakpoint: 1025, settings: { rows: 2, slidesPerRow: 2 } }, { breakpoint: 769, settings: { rows: 2, slidesPerRow: 1 } }, ] }); $('.h4-s').slick({ slidesToShow: 1, autoplay:true, arrows: false, dots:true, // responsive: [ // { // breakpoint: 1200, // settings: { // slidesToShow: 4, // } // }, // { // breakpoint: 768, // settings: { // slidesToShow: 3, // } // }, // { // breakpoint: 520, // settings: { // slidesToShow: 2, // } // } // ] }); $('.h4-s1').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: false, fade: true, autoplay:true, asNavFor: '.h4-s2,.h4-s3' }); $('.h4-s2').slick({ slidesToShow: 1, slidesToScroll: 1, autoplay:true, asNavFor: '.h4-s1,.h4-s3', fade: true, arrows: true, }); $('.h4-s3').slick({ slidesToShow: 3, slidesToScroll: 1, autoplay:true, asNavFor: '.h4-s1,.h4-s2', focusOnSelect: true, arrows: false, responsive: [ { breakpoint: 420, settings: { slidesToShow: 2, } } ] }); // slideW = 320;//一张图300px, 每面四张角度22.5(PI/8),中心角度PI/16 // radius = slideW*0.5/Math.sin(Math.PI/16);//半径。圆心并不是视点中心,视点在1200px eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('a d(){$(".0-5 .2-0").b("6 7 8 c");$(".0-5 .2-0-3").1().4("6");$(".0-5 .2-0-3").1().1().4("7");$(".0-5 .2-0-3").1().1().1().4("8");$(".0-5 .2-0-3").1().1().1().1().4("c")}a e(){$(".0-9 .2-0").b("6 7 8 ");$(".0-9 .2-0-3").1().4("6");$(".0-9 .2-0-3").1().1().4("7");$(".0-9 .2-0-3").1().1().1().4("8")};',15,15,'slide|next|swiper|active|addClass|ha|next1|next2|next3|hc|function|removeClass|next4|his_position|his_positiona'.split('|'),0,{})) // var slideHc = new Swiper('.slide-hc', { // spaceBetween: 0, // autoplay: { // delay: 5000, // stopOnLastSlide: false,disableOnInteraction: false}, // speed:1000, // loop:true, // breakpoints: { // 320: { // slidesPerView: 2, // spaceBetween: 15, // }, // 420: { // slidesPerView:3, // spaceBetween: 20 // }, // 1024: { // slidesPerView:4, // spaceBetween: 30 // } // }, // // navigation: {nextEl: '.slide-hcp .next',prevEl: '.slide-hcp .prev',}, // on: { // init: function(swiper){his_positiona();}, // transitionStart: function (swiper) {his_positiona();} // }, // }); // swiper3.el.onmouseover = function(){ // swiper3.autoplay.stop(); // } // swiper3.el.onmouseout = function(){ // swiper3.autoplay.start(); // } // swiper4.el.onmouseover = function(){ // swiper4.autoplay.stop(); // } // swiper4.el.onmouseout = function(){ // swiper4.autoplay.start(); // } // $(".h5-ico1 .h5-ico").html('资源 183'); // $(".sicoh .h5-ico").each(function (i) { $(this).find('svg').attr('id', 'svg-' + (i + 1)) }) // var g = []; // if (!isIE()) { // $(".sicoh .h5-ico svg").each(function (a, b) { // a = $(this).attr("id"); // g[a] = new Vivus(a, { // type: "delayed", // duration: 80, // inViewport: true, // autostart: true, // }) // }); // $(".sicoh").mouseenter(function () { // g[$(this).find("svg").attr("id")].reset().play() // }); // } // $('.new3-swiper1 ul').slick({ // slidesToShow: 1, // slidesToScroll: 1, // arrows: false, // fade: true, // autoplay:true, // asNavFor: '.new3-swiper2 ul,.new4-swiper1 ul' // }); // // $('.new4-swiper1 ul').slick({ // slidesToShow: 1, // slidesToScroll: 1, // arrows: true, // fade: true, // autoplay:true, // focusOnSelect: true, // asNavFor: '.new3-swiper1 ul,.new3-swiper2 ul' // }); // $('.h4-slick').slick({ // arrows: false, // speed: 300, // fade: true,swipe:false // }) // $('.arrow .swiper-button-prev').click(function () { // $('.h4-slick').slick("prev") // }); // $('.arrow .swiper-button-next').click(function () { // $('.h4-slick').slick("next") // }); // var per2 = new Swiper('.h3-t2', { // loop: true, // speed: 1000, // loopedSlides: 1, // effect : 'fade', // fadeEffect: { // crossFade: true, // }, // // autoplay: { delay: 5000, stopOnLastSlide: false, disableOnInteraction: false }, // navigation: { // nextEl: '.h3-right .swiper-button-next', // prevEl: '.h3-right .swiper-button-prev', // }, // breakpoints: { // // 320: { // // slidesPerView: 2, // // }, // // 420: { // // slidesPerView: 3, // // }, // // 768: { // // slidesPerView: 4, // // }, // // 1024: { // // slidesPerView: 3, // // } // } // }); // var per1 = new Swiper('.h3-t1', { // loop: true, // speed: 1000, // loopedSlides: 1, // // centeredSlides: true, // effect : 'fade', // fadeEffect: { // crossFade: true, // } // }); // per1.controller.control = per2;//Swiper1控制Swiper2,需要在Swiper2初始化后 // per2.controller.control = per1; //视频 // var sz2 = new Swiper('.new5-swiper2', { // speed: 1000, // loop: true, // spaceBetween: 0, // loopedSlides: 3, // effect: 'fade', // fadeEffect: { // crossFade: true, // }, // // autoplay: { delay: 6000, stopOnLastSlide: false, disableOnInteraction: false }, // autoplay: { delay: 6000 }, // breakpoints: { // 320: { // loopedSlides: 2, // }, // 1024: { // loopedSlides: 3, // }, // }, // }); // // vde1.el.onmouseover = function(){ // // vde1.autoplay.stop(); // // } // // vde1.el.onmouseout = function(){ // // vde1.autoplay.start(); // // } // var sz1 = new Swiper('.new5-swiper1', { // loop: true, // speed: 1000, // freeMode: true, // watchSlidesProgress: true, // slideToClickedSlide: true, // pagination: { // el: '.swiper-pagination', // clickable: true, // }, // breakpoints: { // 320: { // slidesPerView: 2, // loopedSlides: 2, // spaceBetween: 10, // }, // 1024: { // slidesPerView: 3, // loopedSlides: 3, // spaceBetween: 40, // centeredSlides: true, // }, // }, // }); // sz1.controller.control = sz2; // sz2.controller.control = sz1; function countdown(){var targetDateStr=$(".datetim").text().trim();var match=targetDateStr.match(/(\d{4})年(\d{1,2})月(\d{1,2})日/);if(match){var year=parseInt(match[1]);var month=parseInt(match[2])-1;var day=parseInt(match[3]);var targetDate=new Date(year,month,day);var now=new Date();now.setHours(0,0,0,0);targetDate.setHours(0,0,0,0);var diff=targetDate.getTime()-now.getTime();var days=Math.max(0,Math.floor(diff/(1000*60*60*24)));$(".day").text(days);}}countdown();