$(function(){ // bshare.init(); if(window.innerwidth>1024){ new wow().init(); } $('.pc-nav li').hover(function() { $(this).find('.navson').stop().slidedown(); },function(){ $(this).find('.navson').stop().slideup(); }); var bodyscroll; $('.nav-btn').on('click',function(e){ e.stoppropagation(); if($(this).hasclass('cur')){ $(this).removeclass('cur'); $('.m-nav').stop().slideup(); // ontouchmove(false); $('body').css("top", "").removeclass('no-scroll'); $(window).scrolltop(bodyscroll); }else{ $(this).addclass('cur'); $('.m-nav').stop().slidedown(); bodyscroll=window.pageyoffset || document.documentelement.scrolltop || document.body.scrolltop || 0; $('body').addclass('no-scroll').css({top : -bodyscroll}); } }); $('.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(); } }) $('header .buy-box').hover(function(){ if(window.innerwidth>1024){ $(this).find('.sub').stop().fadein(); } },function(){ if(window.innerwidth>1024){ $(this).find('.sub').stop().fadeout(); } }) $('.lang-box').hover(function(){ if(window.innerwidth>1024){ $(this).find('.lang-dialog').stop().slidedown(); } },function(){ if(window.innerwidth>1024){ $(this).find('.lang-dialog').stop().slideup(); } }) $('.lang-box .tit').on('click',function(e){ e.stoppropagation(); var _this = $(this); if(window.innerwidth<1025){ if(_this.parent().hasclass('on')){ _this.parent().removeclass('on'); _this.next().stop().slideup(); }else{ _this.parent().addclass('on'); _this.next().stop().slidedown(); } } $('.buy-box').removeclass('on'); $('.nav-btn').removeclass('cur'); $('.buy-box .sub,.m-nav').stop().slideup(); }) $('.buy-box .tit').on('click',function(e){ e.stoppropagation(); var _this = $(this); if(window.innerwidth<1025){ if(_this.parent().hasclass('on')){ _this.parent().removeclass('on'); _this.next().stop().slideup(); }else{ _this.parent().addclass('on'); _this.next().stop().slidedown(); } } $('.lang-box').removeclass('on'); $('.nav-btn').removeclass('cur'); $('.lang-dialog,.m-nav').stop().slideup(); }) $('body').on('click',function(){ $('.buy-box,.lang-box').removeclass('on'); $('.nav-btn').removeclass('cur'); $('.f-left .ico-box .item').removeclass('on'); $('.buy-box .sub,.lang-dialog,.m-nav').stop().slideup(); $('.f-left .ico-box .img-box').stop().fadeout(); }) bodyscroll=window.pageyoffset || document.documentelement.scrolltop || document.body.scrolltop || 0; if(bodyscroll>0&&$('.index-page').length>0&&window.innerwidth>1024){ $('header').addclass('cur'); }else{ $('header').removeclass('cur'); } $(window).on("scroll",function(){ bodyscroll=window.pageyoffset || document.documentelement.scrolltop || document.body.scrolltop || 0; if(bodyscroll>0&&$('.index-page').length>0&&window.innerwidth>1024){ $('header').addclass('cur'); }else{ $('header').removeclass('cur'); } $('.search-dialog').stop().fadeout(); $('.search-black').stop().fadeout(); $('.header-nav').removeclass('on'); }) if($('.not-fix').length==0){ $(window).scroll(function(){ var before = $(window).scrolltop(); $(window).scroll(function() { var after = $(window).scrolltop(); if (before1024&&before>0) { $('header').addclass('headroom--unpinned'); before = after; }; if (before>after&&window.innerwidth>1024) { $('header').removeclass('headroom--unpinned'); before = after; }; }); }); } $('.search-btn').on('click',function(){ bodyscroll=window.pageyoffset || document.documentelement.scrolltop || document.body.scrolltop || 0; $('.search-dialog').stop().fadein(); $('.search-black').stop().fadein(); // $('body').addclass('no-scroll').css({top : -bodyscroll}); // bodyscroll = $('body').position().top; // $(window).scrolltop(bodyscroll); $('.header-nav').addclass('on'); }) $('.search-close,.search-black').on('click',function(){ bodyscroll = $('body').position().top; $('.search-dialog').stop().fadeout(); $('.search-black').stop().fadeout(); // $('body').css("top", "").removeclass('no-scroll'); // $('html,body').stop().animate({scrolltop:-bodyscroll},0); $('.header-nav').removeclass('on'); }) $('.f-lang .select').hover(function(){ if(window.innerwidth>1024){ $(this).find('.sub').stop().show(); } },function(){ if(window.innerwidth>1024){ $(this).find('.sub').stop().hide(); } }) $('.f-lang .select .sub').mcustomscrollbar({ advanced:{ updateoncontentresize: true }, // autohidescrollbar: true }); var preimg = []; $('img').each(function(index,el){ preimg.push($(el).attr('src')); }) _preloadimg(preimg,function(){ if($('.index-page').length==0&&$('.proinfo-box').length==0){ var wintop = $(window).scrolltop(); var contenttop = $('.sub-container').offset().top; if(wintop>contenttop&&window.innerwidth>1024){ $('.sub-container').addclass('fix'); }else{ $('.sub-container').removeclass('fix'); } $(window).on('scroll',function(){ wintop = $(window).scrolltop(); contenttop = $('.sub-container').offset().top; if(wintop>contenttop&&window.innerwidth>1024){ $('.sub-container').addclass('fix'); }else{ $('.sub-container').removeclass('fix'); } }) } if($('.talk-container').length>0){ // $(window).on('scroll resize',function(){ // wintop = $(window).scrolltop(); // var _length = $('.talk-tab-box').length; // for(var i = 0;i < _length ; i++){ // if($(window).scrolltop()>=$('.talk-tab-box').eq(i).offset().top-$('.sub-nav-box').height()){ // $('.talk-aside a').eq(i).addclass('cur').siblings().removeclass('cur'); // } // } // }); $('.talk-aside a').on('click',function(){ var i = $(this).index(); $('html,body').stop().animate({scrolltop:$('.talk-tab-box').eq(i).offset().top-$('.sub-nav-box').height()+2},500) }) } }) $('.law-btn').on('click',function(){ $('.law-dialog-box').stop().fadein(); }) $('.private-btn').on('click',function(){ $('.privacy-dialog-box').stop().fadein(); }) $('.recruit-close,.recruit-dialog-box .black').on('click',function(){ var _this = $(this); _this.parents('.recruit-dialog-box').stop().fadeout(); }) $('.recruit-dialog .con').mcustomscrollbar({ advanced:{ updateoncontentresize: true }, // autohidescrollbar: true }); $('.f-left .ico-box .item').hover(function(){ if(window.innerwidth>1024){ $(this).find('.img-box').stop().fadein(); } },function(){ if(window.innerwidth>1024){ $(this).find('.img-box').stop().fadeout(); } }) $('.f-left .ico-box .ico').on('click',function(e){ var _this = $(this); var thisitem = _this.parent(); e.stoppropagation(); if(window.innerwidth<1025){ if(thisitem.hasclass('on')){ thisitem.removeclass('on'); _this.next().stop().fadeout(); }else{ thisitem.addclass('on'); _this.next().stop().fadein(); } } }) checktime('2020-07-28 19:00:00') function checktime(time1){     var time = date.parse( new date());     var date1 = date.parse(new date(time1.replace(/-/g, '/'))); var link = "";         return false; } if($('.notice-tab .swiper-slide').length>1){ var noticetab = new swiper('.notice-tab',{ direction : 'vertical', loop:true, autoplay:5000, speed:500, slidesperview:"auto", observer:true, observeparents:true }) } if($('.index-page').length>0){ if($(window).scrolltop()>0){ $('.notice-fix').addclass('show'); }else{ $('.notice-fix').removeclass('show'); } $(window).on('scroll',function(){ if($(window).scrolltop()>0){ $('.notice-fix').addclass('show'); }else{ $('.notice-fix').removeclass('show'); } }) $('.notice-fix .close-btn').on('click',function(){ $('.notice-wrap').stop().hide(); }) } $(window).on('scroll',function(){ $('.pc-nav li .navson').stop().slideup(); }) }); function subnav(i){ var subnav = new swiper('.sub-nav',{ initialslide:i-1, slidesperview:"auto", observer:true, observeparents:true, }) } function videoclick(){ var vidcontainer=$(".vidcontainer"), video=$(".vidcontainer video"), videowrap = $('.vidcontainer iframe'); $(".play-btn").on("click",function(ev){ var _this=$(this); var vid=_this.data("src"); var link = _this.data('link'); ev.preventdefault(); if(link){ videowrap.attr('src',link); vidcontainer.fadein(); videowrap.stop().show(); video.stop().hide(); return; }else if(vid){ video.attr("src",vid); vidcontainer.fadein(); video.get(0).play(); videowrap.stop().hide(); video.stop().show(); } }) $(".vidcontainer .closevid,.vidcontainer").on("click",function(ev){ ev.stoppropagation(); if(!$(ev.target).hasclass("video")){ video.get(0).pause(); vidcontainer.fadeout(function(){ video.attr("src",""); videowrap.attr('src',''); videowrap.stop().show(); video.stop().show(); }) } }) } function num(n) { return n<10 ? n = '0'+n : n; } 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; // 返回参数值 }