/*! https://www.bonashenghuang.com
* Copyright (c) 博纳盛煌. All rights reserved.
* https://www.bonashenghuang.com */
/*! default start */
if($(".index-banner-swiper .swiper-slide").length>1) {
if($(".index-banner-swiper .swiper-slide").hasClass("video")) {
$(".index-banner-swiper .swiper-slide video").height($(".index-banner-swiper img").height())
// banner 轮播
var index_banner = new Swiper('.index-banner-swiper', {
pagination: {
el: '.index-banner-swiper .swiper-pagination',
clickable: true,
renderBullet: function (index, className) {
return '' + (index + 1) + '';
},
},
loop: true,
speed: 1200,
on:{
slideChangeTransitionStart: function(){
var _target = this;
var curVideo = this.$el.find(".swiper-slide-active").find("video");
tol=curVideo.duration;
//暂停所有视频
function pauseAll(ele){
ele.find("video").each(function(){
$(this)[0].pause();
});
}
pauseAll(this.$el);
//轮播间隔时间
_target.params.autoplay.delay = tol*1000;
//判断当前激活元素是否有视频
if(curVideo.length > 0){
this.autoplay.stop();
curVideo[0].currentTime = 0;
curVideo[0].play();
curVideo[0].removeEventListener('ended', function (){}, false);
curVideo[0].addEventListener('ended', function (){
_target.slideNext();
}, false);
}else{
_target.params.autoplay.delay=5000;
_target.autoplay.start();
}
},
},
})
}else{
// banner 轮播
var index_banner = new Swiper('.index-banner-swiper', {
pagination: {
el: '.index-banner-swiper .swiper-pagination',
clickable: true,
renderBullet: function (index, className) {
return '' + (index + 1) + '';
},
},
loop: true,
speed: 1200,
autoplay: {
delay: 3000,
disableOnInteraction: false,
},
})
}
$(".index-banner-wrapper").hover(function() {
index_banner.autoplay.stop()
}, function() {
index_banner.autoplay.start()
})
}
function scrollToContent(){
var boxTop = $(".index-box-1").offset().top
if(wid<1024) boxTop-=70
$("body,html").animate({
scrollTop: boxTop
}, 800);
}
/*! default end */
/*! 默认 start */
/*! 默认 end */
/*! 集团介绍数据 start */
$(".data ul li").each(function(i) {
$(this).css("animation-delay", i * .1 + "s")
})
/*! 集团介绍数据 end */
/*! Style B start */
/*! Style B end */
/*! 默认 start */
$(".index-box-5 .cat-box li").eq(0).addClass("on")
$(".index-box-5 .item").eq(0).addClass("on").show()
creatNewsSwiper()
function creatNewsSwiper() {
new Swiper('.index-box-5 .item.on .swiper-container', {
navigation: {
nextEl: '.index-box-5 .next',
prevEl: '.index-box-5 .prev',
},
speed: 1200,
slidesPerView: 2.355,
spaceBetween: 45,
loop: true,
breakpoints: {
1600: {
spaceBetween: 40,
},
1440: {
spaceBetween: 30,
},
1024: {
slidesPerView: 1.4,
spaceBetween: 15,
}
},
})
}
$(".index-box-5 .cat-box a").click(function(){
$(this).parent().addClass("on").siblings().removeClass("on")
$(".index-box-5 .item").eq($(this).parent().index()).addClass("on").fadeIn().siblings().removeClass("on").hide()
creatNewsSwiper()
})
/*! 默认 end */
/*! Style B start */
/*! Style B end */
/*! 默认 start */
/*! 默认 end */
/*! Style A start */
/*! Style A end */