// banner
var swiper = new Swiper(".main-visual-slider .swiper-container", {
loop: true,
speed: 1200,
draggable: false,
autoplay: {
delay: 6000,
disableOnInteraction: false
},
// allowTouchMove: true,
// watchSlidesProgress: true,
pagination: {
el: '.banner .swiper-pagination',
clickable: true,
renderBullet: function (index, className) {
return '' + (index + 1) + '';
},
},
navigation: {
nextEl: '.banner .swiper-button-next',
prevEl: '.banner .swiper-button-prev',
},
on: {
slideChangeTransitionStart : function(swiper){
var swiper = this;
// 判断swiper-slide-active是否有视频
if($(".main-visual-slider .swiper-slide-active video").length>0){
console.log(1)
// 停止自动切换
swiper.autoplay.stop();
// 动态增加id
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();
//重新开始轮播banner
swiper.autoplay.start();
});
}, 10);
}
},
slideChangeTransitionEnd: function(swiper){
//动态移除id
setTimeout(function(){
$(".main-visual-slider .swiper-slide-active video").attr("id","");
}, 10);
},
}
});
// $(function () {
// //切换轮播1
// $(".home1 .tab p").click(function (e) {
// e.preventDefault()
// $(this).addClass('on').siblings().removeClass('on')
// var i = $(this).index();
// // $(".home1 .home-l .title a").eq(i).addClass('on').siblings().removeClass('on');
// tab1.slideTo($(this).index())
// });
// var tab1 = new Swiper('.home1-t .swiper-container', {
// noSwiping: true,
// speed: 800,
// slidesPerView: 1,
// effect: "fade",
// fadeEffect: {
// crossFade: true,
// },
// on: {
// slideChangeTransitionStart: function () {
// $(".home1 .tab p").eq(this.realIndex).addClass('on').siblings().removeClass('on');
// // $(".home1 .home-l .title a").eq(this.realIndex).addClass('on').siblings().removeClass('on');
// }
// }
// });
// })
// home1
$('.infonews16_7_llist1>ul').slick({
autoplay: true,
dots: false,
arrows: true,
accessibility: true,
asNavFor: '.infonews16_7_llist2>ul'
});
$('.infonews16_7_llist2>ul').slick({
autoplay: true,
dots: false,
arrows: false,
accessibility: true,
asNavFor: '.infonews16_7_llist1>ul'
});
$('.h4-s').slick({
autoplay: true,
dots: false,
arrows: true,
infinite: false,
slidesToShow: 5,
slidesToScroll: 1,
responsive: [{
breakpoint: 1025,
settings: {
slidesToShow: 4,
slidesToScroll: 1,
}
}, {
breakpoint: 769,
settings: {
slidesToShow: 3,
slidesToScroll: 1,
}
}, {
breakpoint: 480,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
}
}]
});
$('.h5-s').slick({
autoplay: true,
dots: true,
arrows: false,
infinite: false,
slidesToShow: 7,
slidesToScroll: 1,
responsive: [{
breakpoint: 1025,
settings: {
slidesToShow: 5,
slidesToScroll: 1,
}
}, {
breakpoint: 769,
settings: {
slidesToShow: 4,
slidesToScroll: 1,
}
}, {
breakpoint: 480,
settings: {
slidesToShow: 2,
slidesToScroll: 1,
}
}]
});
$('.h1-t').slick({
infinite: true,
slidesToShow: 1,
slidesToScroll: 1,
arrows:false,
dots:true,
autoplay:true,
});
var new1 = new Swiper('.home1 .swiper-container', {
loop: true,
speed: 1E3,
// autoplay: {
// delay: 6000,
// stopOnLastSlide: false,
// disableOnInteraction: false,
// },
// 如果需要前进后退按钮
pagination: {
el: '.home1 .swiper-pagination',
clickable: true,
renderBullet: function (index, className) {
return '' + '0'+(index + 1) + '';
},
// type: 'fraction',
// renderFraction: function (currentClass, totalClass) {
// return '' +
// ' / ' +
// '';
// },
},
navigation: {
nextEl: '.home1 .swiper-button-next',
prevEl: '.home1 .swiper-button-prev',
},
})
// var l=new Swiper(".hd-slide",{
// slidesPerView:"auto",
// slideToClickedSlide: true,
// watchSlidesProgress:!0,
// loop:!0,
// speed:1E3,
// navigation:
// {prevEl:".homef .next",nextEl:".homef .prev"},
// autoplay:{delay:4E3,stopOnLastSlide:!1,disableOnInteraction:!1},
// on:{progress:function(a){for(a=
// 0;a资源 183');
// function isIE() {
// if (!!window.ActiveXObject || "ActiveXObject" in window) {
// return true;
// } else {
// return false;
// }
// }
// $(".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'
// });
// $('.new3-swiper2 ul').slick({
// slidesToShow: 5,
// slidesToScroll: 1,
// autoplay:true,
// asNavFor: '.new3-swiper1 ul,.new4-swiper1 ul',
// focusOnSelect: true, arrows: false,
// responsive: [
// {
// breakpoint: 1200,
// settings: {
// slidesToShow: 4,
// }
// },
// {
// breakpoint: 768,
// settings: {
// slidesToShow: 3,
// }
// },
// {
// breakpoint: 420,
// settings: {
// slidesToShow: 2,
// }
// }
// ]
// });
// $('.new4-swiper1 ul').slick({
// slidesToShow: 1,
// slidesToScroll: 1,
// arrows: true,
// fade: true,
// autoplay:true,
// focusOnSelect: true,
// asNavFor: '.new3-swiper1 ul,.new3-swiper2 ul'
// });
// $('.h6-slick').slick({
// arrows: false,
// speed: 300,
// fade: true,swipe:false
// })
// $('.arrow .swiper-button-prev').click(function () {
// $('.h6-slick').slick("prev")
// });
// $('.arrow .swiper-button-next').click(function () {
// $('.h6-slick').slick("next")
// });
var per2 = new Swiper('.home6 .swiper-container', {
loop: true,
speed: 1000,
slidesPerView: 4,
autoplay: { delay: 5000, stopOnLastSlide: false, disableOnInteraction: false },
navigation: {
nextEl: '.home6 .swiper-button-next',
prevEl: '.home6 .swiper-button-prev',
},
breakpoints: {
320: {
slidesPerView: 2,
spaceBetween: 10,
},
420: {
slidesPerView: 3,
spaceBetween: 20,
},
768: {
slidesPerView: 4,
spaceBetween: 35,
},
1024: {
slidesPerView: 4,
spaceBetween: 40,
}
}
});
// var per1 = new Swiper('.hom6-l .swiper-container', {
// loop: true,
// speed: 1000,
// loopedSlides: 3,
// // centeredSlides: true,
// effect : 'fade',
// fadeEffect: {
// crossFade: true,
// }
// });
// per1.controller.control = per2;//Swiper1控制Swiper2,需要在Swiper2初始化后
// per2.controller.control = per1;