// 搜索 $(".bocweb-header .header-right .searchs,.m-header .nav-sousuo").on("click",function(){ $(" .search-dialogbox").fadeIn(); $('.search-dialog').stop().fadeIn(); $('.search-black').stop().fadeIn(); }) $('.search-close,.search-black').on('click',function(){ $(" .search-dialogbox").fadeOut(); $('.search-dialog').stop().fadeOut(); $('.search-black').stop().fadeOut(); }) function main(id,id2){ $(".bocweb-header .items").eq(id).addClass("active").find(".items-tops").addClass("active"); $(".bocweb-header .items.active .items-bots .i").eq(id2).addClass("active"); } // pc导航 $(".bocweb-header .bocweb-nav .items .items-tops").on("mouseenter",function(){ $(this).parents(".items").find(".header-bottoms").stop(true,true).slideToggle().parents(".items").siblings().find(".header-bottoms").stop(true,true).slideUp(); $(this).parents(".items").find(".items-bots").stop(true,true).slideToggle().parents(".items").siblings().find(".items-bots").stop(true,true).slideUp(); }) $(".bocweb-header .bocweb-nav .items").on("mouseleave",function(){ $(".bocweb-header .items").find(".header-bottoms").stop(true,true).slideUp(); $(".bocweb-header .items").find(".items-bots").stop(true,true).slideUp(); }) $(".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 maxnum(select){ select.innerHeight("auto"); setTimeout(function(){ var _heights = []; select.each(function(){ var _height = Math.floor($(this).innerHeight() - 1); _heights.push(_height) }) select.innerHeight(Math.max.apply(null, _heights)) },50) $(window).resize(function(event) { select.innerHeight("auto"); setTimeout(function(){ _heights = []; select.each(function(){ var _height = Math.floor($(this).innerHeight() - 1); _heights.push(_height) }) select.innerHeight(Math.max.apply(null, _heights)) },50) }); } $(document).scroll(function(){ var m_top0=$(".con-header").offset().top; var top = ($(window).scrollTop()); if(m_top0 >= top){ $(".w-header,header.header").removeClass('fixed'); $("body").removeClass("onsactive-on"); }else if(m_top0 <= top){ $(".w-header,header.header").addClass('fixed'); $("body").addClass("onsactive-on"); } }); // header 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(); 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; }