var svgbox =
'
'
+''+'
'
// console.log(svgbox);
$(".svgbox").append(svgbox);
if($("div").hasClass('crystalleft-swiper')){
var crystalleftswiper = new Swiper('.crystalleft-swiper .swiper-container', {
slidesPerView : 2.5,
spaceBetween : 20,
nextButton: '.crystalleft-swiper .swiper-button-next',
prevButton: '.crystalleft-swiper .swiper-button-prev',
slideToClickedSlide:true,
breakpoints: {
400: {
slidesPerView: 1,
},
768: {
slidesPerView: 1.5,
}
},
})
}
function scrollAnimation2(ele) {
$(ele).each(function() {
var _this = $(this);
if (_this.offset().top > $(window).scrollTop() + $(window).height() || _this.offset().top < $(window).scrollTop() - _this.outerHeight()) {
// _this.removeClass('animate');
} else if ($(window).scrollTop() >= _this.offset().top - $(window).height() * 1) {
_this.addClass('animate');
setInterval(function(){
$("body").addClass("avh0");
},50)
// _this.find(".k10 .ul").addClass('animate');
_this.find(".loading-sw").remove();
}
});
$(window).scroll(function(){
$(ele).each(function() {
var _this = $(this);
if (_this.offset().top > $(window).scrollTop() + $(window).height() || _this.offset().top < $(window).scrollTop() - _this.outerHeight()) {
// _this.removeClass('animate');
} else if ($(window).scrollTop() >= _this.offset().top - $(window).height() * 1) {
// console.log($(window).scrollTop() ,_this.offset().top - $(window).height() * 0.8)
_this.addClass('animate');
// _this.find(".k10 .ul").addClass('animate');
_this.find(".loading-sw").remove();
}
});
});
}
var wow = new WOW({
boxClass: 'wow',
animateClass: 'animated',
offset:150,
mobile: true,
live: true
});
wow.init();
function zxjy(id,id1){
$(".bocweb-header .header-right .nav-li").eq(id).addClass('active').find(".nav-top").addClass("active");
$(".bocweb-header .nav-li.active .nav-bot .hleft .hli").eq(id1).addClass("active");
if($("div").hasClass("con-column")){
// var idnum = $(".con-column").attr("data-num");
var idnum = $(".con-column .swiper-container .swiper-slide").length;
// console.log(idnum);
if($(window) <= 1023 || idnum >= 3){
idnum = 2.5;
}else{
idnum = 2;
}
var abtit = new Swiper('.con-column .swiper-container', {
slidesPerView : "auto",
noSwiping : true,
breakpoints: {
1023: {
slidesPerView: idnum,
noSwiping : false,
},
400: {
slidesPerView: 1.8,
noSwiping : false,
},
}
})
$(".con-column .swiper-slide").eq(id1).find(".item").addClass("active");
abtit.slideTo(id1, 0, false);
}else{
return false;
}
}
function Remove(ele){
$(ele).contents().filter(function() {
return this.nodeType === 3;
}).remove();
}
Remove(".pagination,.kh")
scrollAnimation2($('.secwen'));
scrollAnimation2($('.conban-bg'));
function clickVideo(selector){
var video = document.getElementById('video');
selector.on('click',function(){
var videoSrc = $(this).attr('data-src');
$('#video').attr('src',videoSrc);
$('.video-fixed').stop().fadeIn();
video.play();
})
$('.video-fixed .cha').on('click',function(){
$('.video-fixed').stop().fadeOut();
video.pause();
$('#video').attr('src',"");
})
$(".video-fixed").on("click",function(){
$(".video-fixed").fadeOut();
$('#video').attr('src',"");
})
$(".video-fixed .videoboxs").on("click",function(e){
e.stopPropagation()
})
}
function visual_button_scroll_down(){
$(".idem").each(function(){
$(this).on('click',function(){
var target = $(this).attr('href');
var target_top = $(target).offset().top-64;
$('html,body').animate({
scrollTop : target_top
},1500, 'easeInOutQuad');
return false;
});
})
}
visual_button_scroll_down();
// window.addEventListener('scroll', function(event) {
// var depth, layer, layers, movement, topDistance, translate3d, _i, _len;
// topDistance = this.pageYOffset;
// layers = document.querySelectorAll("[data-type='parallax']");
// for (_i = 0, _len = layers.length; _i < _len; _i++) {
// layer = layers[_i];
// depth = layer.getAttribute('data-depth');
// movement = -(topDistance * depth/5);
// // translate3d = 'translate3d(0, ' + movement + 'px, 0)';
// translate3d = 'matrix(1, 0, 0, 1, 0 , ' + movement + ')';
// layer.style['-webkit-transform'] = translate3d;
// layer.style['-moz-transform'] = translate3d;
// layer .style['-ms-transform'] = translate3d;
// layer.style['-o-transform'] = translate3d;
// layer.style.transform = translate3d;
// }
// });
if($("body").hasClass("service-body")){
// zs(6,0);
// $(".bocweb-header .nav-li").eq(3).find(".nav-top").addClass("active");
}
if($("body").hasClass("news-body")){
// zs(5,0);
}