// header // pc瀵艰埅 $(".bocweb-mainnav-left .bocweb-subnav-top").on("mouseenter",function(){ $(this).parents(".bocweb-subnav").find(".bocweb-subnav-bot").stop(true,true).slideToggle().parents(".bocweb-subnav").siblings().find(".nav-bot").stop(true,true).slideUp(); }) $(".bocweb-mainnav-left .bocweb-subnav").on("mouseleave",function(){ $(".bocweb-mainnav-left .bocweb-subnav").find(".bocweb-subnav-bot").stop(true,true).slideUp(); }) $(".bocweb-mainnav-right .items2 .items-top").on("mouseenter",function(){ $(this).parents(".items2").find(".items-bot").stop(true,true).slideToggle().parents(".items2").siblings().find(".nav-bot").stop(true,true).slideUp(); }) $(".bocweb-mainnav-right .items2").on("mouseleave",function(){ $(".bocweb-mainnav-right .items2").find(".items-bot").stop(true,true).slideUp(); }) $(".bocweb-footer .footertop-left .inputs input[type=submit]").on("click",function(){ $(".suoqu-box1").fadeIn(); }) $(".suoqu").on("click",function(){ $(".suoqu-box2").fadeIn(); }) $(".suoqu-box .close").on("click",function(){ $(".suoqu-box").fadeOut(); }) // header function mains(id,id1){ $(".bocweb-mainnav-left .bocweb-subnav").eq(id).addClass('active').find(".bocweb-subnav-top").addClass('active'); $(".bocweb-subnav.active .bocweb-subnav-bot .subnav").eq(id1).addClass('active'); } $(".com-more .a1").hover(function () { var ni = $(this).toggleClass('ac1'); setTimeout(function () { ni.toggleClass('ac2'); }, 200) }); $(document).scroll(function(){ var m_top0=$(".m-header").offset().top; var pc_top0=$(".pcheader").offset().top; var top = ($(window).scrollTop()); if(m_top0 >= top){ $(".w-header").removeClass('fixed'); }else if(m_top0 <= 0){ $(".w-header").addClass('fixed'); } if(pc_top0 >= top){ $(".bocweb-header").removeClass('fixed'); }else if(pc_top0 <= 0){ $(".bocweb-header").addClass('fixed'); } }); // 鎵嬫満瀵艰埅 $(".m-header .nav-btn").on('click', function() { var _this = $(this); if (!$(this).hasClass('hover')) { $(".search-bg").slideUp(); $(this).addClass('hover'); $(this).children('.line1').stop().transition({rotate:45},300); $(this).children('.line2').stop().fadeOut(300); $(this).children('.line3').stop().transition({rotate:-45},300,function(){ _this.addClass('active'); }); $(this).parents(".w-header").siblings('.sub-menu').stop().fadeIn(); $(".m-header .list-cont").addClass('active'); $("body,html").addClass('ovh'); }else{ $(this).removeClass('hover'); $(this).removeClass('active'); $(this).children('.line1').stop().transition({rotate:0},300); $(this).children('.line2').stop().fadeIn(300); $(this).children('.line3').stop().transition({rotate:0},300); $(this).parents(".w-header").siblings('.sub-menu').stop().fadeOut(); $(".m-header .list-cont").removeClass('active'); $("body,html").removeClass('ovh'); } }); $(".m-header .sub-menu .sub-tit").on('click', function() { $(".m-header .search-bg").slideUp(); if ($(this).siblings('.sec-list').is(':hidden')){ $(this).addClass('on'); $(this).siblings('.sec-list').stop().slideDown(); $(this).parent().siblings('li').children('.sec-list').stop().slideUp().siblings('.tit').removeClass('on'); }else{ $(this).removeClass('on'); $(this).siblings('.sec-list').stop().slideUp(); } }); // header function leftbar(ids){ if($("div").hasClass('fixed-left-swiper')){ var fixedleftswiper = new Swiper('.fixed-left-swiper .swiper-container', { direction : 'vertical', followFinger : false, slidesPerView : "auto", centeredSlides : true, }) } ids.each(function(i){ var j = i+1; var f = ids; var g = 500; function serve1(){ if(j == f.length){ if($(window).scrollTop() >= ($(f[i]).offset().top - g)){ fixedleftswiper.slideTo(i, 500, false); } }else{ var k = i -1; // console.log($(f[i])); if($(window).scrollTop() >= ($(f[i]).offset().top - g) & $(window).scrollTop() < ($(f[j]).offset().top) - g){ fixedleftswiper.slideTo(i, 500, false); // console.log(i); } } } $(window).scroll(function(){ serve1 (); }) }) } function barken(dataid){ var dataids =$(" .wel-banner .buts .bannerswiper .ibox").find(".i").eq(dataid); var arrowW=dataids.innerHeight(); var arrowT0=dataids.position().left; var mt0 =dataids.outerHeight(true) - dataids.outerHeight(); $(".bannerswiper .ibox .1").eq(dataid).addClass("active"); var line = $('.bannerswiper .bar'); line.stop().animate({ height: arrowW, left: arrowT0+mt0 }); $(window).resize(function(event) { var dataids =$(".bannerswiper .ibox").find(".i").eq(dataid); var arrowW=dataids.innerHeight(); var arrowT0=dataids.position().left; var mt0 =dataids.outerHeight(true) - dataids.outerHeight(); $(".bannerswiper .ibox .1").eq(dataid).addClass("active"); var line = $('.bannerswiper .bar'); line.stop().animate({ height: arrowW, left: arrowT0+mt0 }); }); } 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:10, mobile: true, live: true }); wow.init(); 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(){ $('.video-fixed').stop(true,true).removeClass('ons').hide(); $('.video-fixed').fadeIn().delay(500).addClass('ons'); // video.play(); $("html,body").addClass('on-foxed') var videoSrc = $(this).attr('data-src'); $('#video').fadeIn(500).attr('src',videoSrc); }) $('.video-fixed .cha').on('click',function(){ $('.video-fixed').removeClass('ons').delay(500).fadeOut(); // video.pause(); $("html,body").removeClass('on-foxed') $('#video').fadeOut(500).attr('src',""); }) $(".video-fixed").on("click",function(){ $('.video-fixed').removeClass('ons').delay(500).fadeOut(); $("html,body").removeClass('on-foxed') $('#video').fadeOut(500).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(); function getUrlParam(name){ var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r!=null) return unescape(r[2]); return null; }