$(function(){ var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset:150, mobile: false, live: true }); if(window.innerWidth>1024){ // wow.init(); } $('.nav-btn').on('click',function(e){ e.stopPropagation(); if($(this).hasClass('cur')){ $(this).removeClass('cur'); $('.m-nav').stop().slideUp(); }else{ $(this).addClass('cur'); $('.m-nav').stop().slideDown(); } }); $('.m-nav li .tit').on('click',function(e){ e.stopPropagation(); var _this = $(this); var thisLi = _this.parent(); if(thisLi.hasClass('on')){ thisLi.removeClass('on'); _this.next().stop().slideUp(); }else{ thisLi.addClass('on').siblings().removeClass('on'); $('.m-nav li .navson').stop().slideUp(); _this.next().stop().slideDown(); } }) $('.m-nav .sec-tit').on('click',function(e){ e.stopPropagation(); var _this = $(this); var thisItem = _this.parent(); if(thisItem.hasClass('on')){ thisItem.removeClass('on'); _this.next().stop().slideUp(); }else{ thisItem.addClass('on').siblings().removeClass('on'); $('.m-nav li .third-nav').stop().slideUp(); _this.next().stop().slideDown(); } }) $('.search-btn').on('click',function(e){ e.stopPropagation(); $('.search-dialog').stop().fadeIn(); $('.header-right').addClass('on'); }) $('.search-dialog .search').on('click',function(e){ e.stopPropagation(); }) $('.search-close').on('click',function(){ $('.search-dialog').stop().fadeOut(); $('.header-right').removeClass('on'); }) $('body').on('click',function(){ $('.search-dialog').stop().fadeOut(); $('.header-right').removeClass('on'); }) $('.pc-nav li').hover(function(){ if(window.innerWidth>1024){ $(this).find('.navson').stop().fadeIn(); } },function(){ if(window.innerWidth>1024){ $(this).find('.navson').stop().hide(); } }) $('.footer-top .link-box').hover(function(){ if(window.innerWidth>1024){ $(this).addClass('on'); $(this).find('.sub').stop().show(); } },function(){ if(window.innerWidth>1024){ $(this).removeClass('on'); $(this).find('.sub').stop().hide(); } }) $('.footer-top .link-box .sub').mCustomScrollbar({ advanced:{ updateOnContentResize: true }, // autoHideScrollbar: true }); $('.footer-top .link-box .tit').on('click',function(){ var _this = $(this); var select = _this.parent(); if(window.innerWidth<1025){ if(select.hasClass('on')){ select.removeClass('on'); _this.next().stop().hide(); }else{ select.addClass('on'); _this.next().stop().show(); } } }) $('.footer-top .link-box .sub a').on('click',function(){ var _this = $(this); $('.footer-top .link-box').removeClass('on'); _this.parents('.sub').stop().hide(); }) $('.middle-tab .con-box').hover(function(){ if(window.innerWidth>1024){ $(this).find('.con').stop().slideDown(); } },function(){ if(window.innerWidth>1024){ $(this).find('.con').stop().slideUp(); } }) $('.sub-banner .scroll-btn').on('click',function(){ $('html,body').stop().animate({scrollTop:$('.sub-banner').next().offset().top-$('header').height()},500); }) $('.header-right .qrcode-box,.footer-top .top-box .f-share .item').hover(function(){ if(window.innerWidth>1024){ $(this).find('.qrcode-drop').stop().fadeIn(); } },function(){ if(window.innerWidth>1024){ $(this).find('.qrcode-drop').stop().fadeOut(); } }) $('.qrcode-btn,.f-share .icon').on('click',function(){ var _this = $(this); var thisItem = _this.parent(); if(window.innerWidth<1025){ if(thisItem.hasClass('on')){ thisItem.removeClass('on'); _this.next().stop().fadeOut(); }else{ thisItem.addClass('on'); _this.next().stop().fadeIn(); } } }) $('.f-nav li .tit').on('click',function(){ var _this = $(this); var thisItem = _this.parent(); if(window.innerWidth<768){ if(thisItem.hasClass('on')){ thisItem.removeClass('on'); _this.next().stop().slideUp(); }else{ thisItem.addClass('on').siblings().removeClass('on'); $('.f-nav li .navson').stop().slideUp(); _this.next().stop().slideDown(); } } }) $('.f-nav .sec-tit').on('click',function(e){ e.stopPropagation(); var _this = $(this); var thisItem = _this.parent(); if(thisItem.hasClass('on')){ thisItem.removeClass('on'); _this.next().stop().slideUp(); }else{ thisItem.addClass('on').siblings().removeClass('on'); $('.f-nav li .third-nav').stop().slideUp(); _this.next().stop().slideDown(); } }) $('.pc-nav li .navson').width($(window).width() - $('.pc-nav').offset().left); $(window).on('resize',function(){ $('.pc-nav li .navson').width($(window).width() - $('.pc-nav').offset().left); }) $('.top-btn').on('click',function(){ $('html,body').stop().animate({scrollTop:0},800); }) var winTop = $(window).scrollTop(); if(winTop>0){ $('.top-btn').stop().fadeIn(); }else{ $('.top-btn').stop().fadeOut(); } $(window).on('scroll resize',function(){ winTop = $(window).scrollTop(); if(winTop>0){ $('.top-btn').stop().fadeIn(); }else{ $('.top-btn').stop().fadeOut(); } }) }); function middleTab(){ var middleSwiper = new Swiper('.middle-tab',{ slidesPerView:3, slidesPerGroup:3, // freeMode:true, // scrollbar:'.middle-tab .scrollbar', // scrollbarHide : false, // scrollbarDraggable : true prevButton:".middle-tab-box .pub-prev", nextButton:".middle-tab-box .pub-next", breakpoints:{ 767:{ slidesPerView:1, slidesPerGroup:1, } } }) } function videoClick(){ var vidcontainer=$(".vidcontainer"), video=$(".vidcontainer video"); $(".play-btn").on("click",function(ev){ var _this=$(this); var vid=_this.data("src"); ev.preventDefault(); video.attr("src",vid); vidcontainer.fadeIn(); video.get(0).play(); }) $(".vidcontainer .closevid,.vidcontainer").on("click",function(ev){ ev.stopPropagation(); if(!$(ev.target).hasClass("video")){ video.get(0).pause(); vidcontainer.fadeOut(function(){ video.attr("src",""); }) } }) } function dataTab(){ var dataSwiper = new Swiper('.data-list-tab',{ slidesPerView:"auto", prevButton:".data-list .prev", nextButton:".data-list .next" }) } 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; // 返回参数值 } function navScroll(){ var preImg = []; $('img').each(function(index,el){ preImg.push($(el).attr('src')); }) _PreLoadImg(preImg,function(){ var winS = $(window).scrollTop(); var _id = getUrlParam('id'); if(_id){ $('html,body').stop().animate({scrollTop:$('.position').eq(_id).offset().top-$('header').height()+2},500) } }) } function payTab() { // $('.tab-list .item').eq(0).addClass('cur'); // $('.tab-list .item').eq(0).find('.con').stop().show(); // var imgSwiper = new Swiper('.pay-ser .img-list',{ // speed:400, // effect:'fade', // // loop:true, // fade: { // crossFade: true // }, // autoplay:5000, // pagination: '.pay-ser .img-list .btns', // paginationClickable: true // }) // $('.pay-ser .tab-list .item').hover(function(){ // var _this = $(this); // var i = _this.index(); // _this.addClass('cur').siblings().removeClass('cur'); // $('.tab-list .con').stop().hide(); // _this.find('.con').stop().show(); // imgSwiper.slideTo(i); // }) var paySwiper = new Swiper('.pay-tab',{ slidesPerView:"auto", prevButton:".pay-tab-box .pub-prev", nextButton:".pay-tab-box .pub-next" }) }