var banner = new Swiper('.banner .swiper-container',{
effect:"fade"
});
var se3 = new Swiper('.se3-lists .swiper-container', {
autoplay: 6000,//可选选项,自动滑动
slidesPerView: "auto",
centeredSlides: true,
spaceBetween: 15,
speed:600,
loop:true,
prevButton:'.se3-lists .swiper-button-prev',
nextButton:'.se3-lists .swiper-button-next',
breakpoints:{
1023: {
slidesPerView: 1.5,
spaceBetween: 10
},
767: {
slidesPerView: 1.2,
spaceBetween: 10
},
}
});
var video = document.getElementById("pcvideo");
$('#fullpage').fullpage({
'scrollingSpeed': 800,
'verticalCentered': false,
'resize':true,
'css3': true,
// 'anchors':['01', '02', '03', '04', '05'],
'navigationTooltips':['01', '02', '03', '04', '05'],
'navigation': true,
'menu': '#menu',
'navigationPosition':'right',
afterLoad: function(anchorLink, index){
var loadedSection = $(this);
$(".bocweb-header").addClass("active2")
$(".bocweb-header").removeClass("whitefixed2")
if(index == 1){
$(".banner .secwen").removeClass('animate');
$(".banner .swiper-slide-active .secwen").addClass('animate');
$(".bocweb-header").removeClass("active2")
setTimeout(function(){
if($(".banner .swiper-slide-active").hasClass('videoboxs') && $(window).innerWidth() >= 1024){
banner.stopAutoplay();
// video.load();
video.play();
video.addEventListener("ended",function () {
});
}else{
banner.startAutoplay();
banner.params.autoplay = 6000;
}
},200);
}
if(index == 2){
$('.section2').addClass('animate');
$(".section2").find(".secwen").addClass("animate");
time();
}
if(index == 3){
$(".section3").find(".secwen").addClass("animate");
}
if(index == 4){
$('.section4').addClass('animate');
$(".section4").find(".secwen").addClass("animate");
}
if(index == 5){
$(".section5").find(".secwen").addClass("animate");
// $(".fixed-bottoms2").show();
$(".bocweb-header").addClass("whitefixed2")
}
if(index == 6){
$(".section5").find(".secwen").addClass("animate");
}
},
onLeave: function(index, nextIndex, direction){
var leavingSection = $(this);
if(direction =='down' && nextIndex == 2){
$(".wel-bottoms").removeClass("on");
};
if(direction =='up' && nextIndex == 5){
// return false;
}
if(direction =='down' && nextIndex == 6){
$(".section5").find(".secwen").addClass("animate");
// $(".fixed-bottoms2").show();
$(".fixed-bottoms2,#fp-nav").hide();
}else if(direction =='up' && nextIndex == 5){
$(".fixed-bottoms2,#fp-nav").show();
}
}
})
if($(".banner .swiper-slide").length >1){
var banner = new Swiper('.banner .swiper-container',{
prevButton:'.banner .swiper-button-prev',
nextButton:'.banner .swiper-button-next',
pagination : '.banner .swiper-pagination',
// paginationClickable: true,
centeredSlides: true,
slidesPerView: 1,
spaceBetween: 0,
initialSlide:0,
speed:1000,
autoplay : 6000,
effect:"fade",
slideToClickedSlide:true,
autoplayDisableOnInteraction: false,
lazyLoading : true,
lazyLoadingInPrevNext : true,
roundLengths : true,
noSwiping : true,
onInit:function(swiper){
var index = swiper.activeIndex + 1;
var len = $(".banner .swiper-slide").length;
setTimeout(function(){
if($(".banner .swiper-slide-active").hasClass('videoboxs') && $(window).innerWidth() >= 1024){
swiper.stopAutoplay();
video.load();
// video.muted = false;
video.play();
video.addEventListener("ended",function () {
swiper.startAutoplay();
// swiper.slideNext();
});
}else{
swiper.startAutoplay();
// video.muted = true;
// video.paused();
swiper.params.autoplay = 6000;
}
},200);
var svgbox =
'
'
+''
+' '
+' '
+' '+'
'
$(".wel-banner .btns .swiper-pagination-bullet").html(svgbox);
},
breakpoints: {
767: {
loop:true,
noSwiping : false
},
},
onBeforeResize:function(){
var svgbox =
''
+''
+' '
+' '
+' '+'
'
$(".wel-banner .btns .swiper-pagination-bullet").html(svgbox);
},
onImagesReady:function(){
$(".banner .secwen").removeClass('animate');
$(".banner .swiper-slide-active .secwen").addClass('animate');
var svgbox =
''
+''
+' '
+' '
+' '+'
'
$(".wel-banner .btns .swiper-pagination-bullet").html(svgbox);
},
onSlideChangeStart: function(swiper){
var index = swiper.activeIndex + 1;
var len = $(".banner .swiper-slide").length;
var svgbox =
''
+''
+' '
+' '
+' '+'
'
$(".wel-banner .btns .swiper-pagination-bullet").html(svgbox);
setTimeout(function(){
if($(".banner .swiper-slide-active").hasClass('videoboxs') && $(window).innerWidth() >= 1024){
swiper.stopAutoplay();
// video.load();
// video.muted = false;
video.play();
video.addEventListener("ended",function () {
swiper.startAutoplay();
// swiper.slideNext();
});
}else{
swiper.startAutoplay();
// video.muted = true;
// video.paused();
swiper.params.autoplay = 6000;
}
},200);
},
})
}else{
$(".wel-banner").addClass("activesss");
$(".wel-banner video").attr("loop",true)
}
// banner.slideTo(1, 0, false);
// banner.slideTo(0, 0, false);
$(".svgsio").on("click",function(){
$(".svgsio").toggleClass("toggle");
if($(".svgsio").hasClass("toggle")){
video.muted = false;
// video.play();
}else{
video.muted = true;
// video.pause();
}
})
// $(".wel-banner video").on("click",function(){
// $(".wel-banner").toggleClass("toggle");
// if($(".wel-banner").hasClass("toggle")){
// video.muted = false;
// video.play();
// }else{
// video.muted = true;
// video.pause();
// }
// })
$(".wel-banner .btns .swiper-pagination-bullet").on("click",function(){
var index = $(this).index();
banner.slideTo(index, 1000, false);
setTimeout(function(){
if($(".banner .swiper-slide-active").hasClass('videoboxs') && $(window).innerWidth() >= 1024){
banner.stopAutoplay();
// video.load();
video.play();
video.addEventListener("ended",function () {
});
}else{
banner.startAutoplay();
banner.params.autoplay = 6000;
}
},200);
})
// section2 第二屏
// 第一屏 视频
function vdieoresize(){
var W1= $(window).width();
var H1= $(window).height();
if ((W1/H1)>(16/9)) {
// alert(0)
$(".section1 .videoboxs video").height(W1*9/16);
}else{
// alert(1)
$(".section1 .videoboxs video").width(H1*16/9);
}
}
vdieoresize();
$(window).on("resize",function(){
vdieoresize();
})
function banner_video(){
$(".banner .secwen").removeClass('animate');
$(".banner .swiper-slide-active .secwen").addClass('animate');
setTimeout(function(){
if($(".banner .swiper-slide-active").hasClass('videoboxs') && $(window).innerWidth() >= 1024){
swiper.stopAutoplay();
// video.load();
video.muted = false;
video.play();
video.addEventListener("ended",function () {
swiper.slideNext();
});
}else{
swiper.startAutoplay();
swiper.params.autoplay = 6000;
}
},200);
}
function time(){
var _b=true;
var options = {
useEasing: true,
useGrouping: true,
separator: '',
decimal: '.'
};
if($(".wel-section2 .items4 .lists.add5 .li").eq(0).find(".tits").text()!= 0){
return;
}
if($(".section2").hasClass("animate")){
setTimeout(function(){
var demoFi1 = new CountUp("one", 0, $("#one").attr("end-val"),0,2, options);
demoFi1.start();
var demoFi2 = new CountUp("two", 0, $("#two").attr("end-val"),0,2, options);
demoFi2.start();
var demoFi3 = new CountUp("three",0, $("#three").attr("end-val"),0,2, options);
demoFi3.start();
var demoFi4 = new CountUp("four",0, $("#four").attr("end-val"),0,2, options);
demoFi4.start();
},50)
}
_b = false;
}
//
if($(window).innerWidth()>1024){
$(".se3-lists .swiper-bots .swiper-slide").on("mouseenter",function(){
$(this).addClass("active").siblings("").removeClass("active");
})
$(".se3-lists .swiper-bots").on("mouseleave",function(){
$(".se3-lists .swiper-bots .swiper-slide").removeClass("active");
})
}
var section2swiper = new Swiper('.section2-swiper .swiper-container',{
slidesPerView : 2,
pagination : '.section2-swiper .swiper-pagination',
paginationClickable :true,
})
var listsbox2 = new Swiper('.w-listsbox .swiper-container',{
slidesPerView : 1,
pagination : '.se5-items1 .swiper5list',
paginationClickable :true,
})
var se5 = new Swiper('.se5-items2 .swiper-container',{
slidesPerView : 1,
pagination : '.se5-items2 .swiper5list',
paginationClickable :true,
})
$(".wel-section2 .items2 .li").on("mouseenter",function(){
$(this).addClass("active").siblings().removeClass("active");
})
clickVideo($(".wel-section2 .items3,.wel-banner .videoboxs .imgs"))
$(".wel-section2 .items2 .li").eq(1).addClass("active");