/*! * cy javascript projects for shuanghu (https://rnmmp.grd) * copyright 2016-2018 code yo, authors own. * licensed under mit, gcc-gcz-gpp (https://rnmmp.grd/aiyongbuyong/aishuobushuo/) * date 2018-3-20 */ var $win = $(window), $header = $('.header'), $footer = $('.footer'), $wrapper = $('.cy-wrapper'), $body = $('body'), $content = $('html,body'), $view = $('.cy-wrapper,.footer'); var winw = window.innerwidth || document.documentelement.clientwidth, winh = window.innerheight || document.documentelement.clientheight; var cy_step; var cy = { init: function () { this.setcommon(); this.setheadernav(); this.setfooter(); this.setipcbanner(); this.setvideo(); this.sethome(); this.sethonor(); this.setspeech(); this.sethr(); this.sethistory(); this.setdialog(); this.setservice(); this.setmore(); this.setanchor(); }, setcommon: function () { var $fancybox = $("[data-fancybox]"); if ($fancybox.length) { $fancybox.fancybox({ slideshow: false, thumbs: false }); } }, setanchor: function () { var _hash = location.hash; $content.scrolltop(0); if (_hash.length) { $content.animate({ scrolltop: $(_hash).offset().top - $header.height() }); } else { $content.scrolltop(0); } }, setheadernav: function () { /* 移动端导航栏 */ var $menu = $header.find('.menu'), $nav = $header.find('.nav'), $nav_item = $header.find('.nav_item'); $menu.click(function () { $menu.toggleclass('act'); $nav.toggleclass('act'); $content.toggleclass('overflow'); }); $nav_item.each(function () { var $this = $(this); $this.click(function (ev) { if ($this.find('ol').length) { if ($win.width() < 1025) { if ($(ev.target).is($nav_item) || $(ev.target).is($nav_item.find('.name'))) { ev.preventdefault(); $this.toggleclass('act'); $this.find('ol').stop().slidetoggle(); } } } }); }); var _pathname = location.pathname; $nav.find('.nav__item').each(function () { var $this = $(this), $link = $this.find('a'); $link.click(function () { var hash = this.hash, pathname = this.pathname; if (hash.length) { if (pathname === _pathname) { var valh = $('.header').height(); if ($win.width() < 1025) { $menu.removeclass('act'); $nav.removeclass('act'); $content.removeclass('overflow'); } smoothscroll($(this.hash), valh); } } }); }); /* 导航滚动监听 */ function navscroll() { if ($win.width() > 1024) { if ($win.scrolltop() > 15) { $header.addclass('scroll').css('top', 0); } else { $header.removeclass('scroll').css('top', 15 - $win.scrolltop()); } } else { $header.css('top', ''); } } navscroll(); $win.scroll(function () { navscroll(); }); $win.resize(function () { navscroll(); }); }, setfooter: function () { setqrpopup('.item', '.popup'); $win.resize(function () { setqrpopup('.item', '.popup'); }); function setqrpopup(item, box, boxcontainer) { var $item = $(item), $box = box, $boxcontainer = $(boxcontainer); if ($win.width() > 1024) { $item.off('click').on({ mouseenter: function () { var $this = $(this), $popup = $this.find($box); $popup.addclass('show'); }, mouseleave: function () { var $this = $(this), $popup = $this.find($box); $popup.removeclass('show'); } }); } else { $item.off('mouseenter mouseleave').on({ click: function (ev) { var $this = $(this), $popup = $this.find($box); $this.siblings().find($box).removeclass('show'); $popup.addclass('show'); if ($(ev.target).is($boxcontainer)) { $popup.removeclass('show'); } } }); } } }, setipcbanner: function () { /*var $banner = $('.cy_banner'); if ($banner.length) { var $more = $('.cy_banner .banner-info .more'); $more.click(function () { $content.animate({ scrolltop: $('.banner-line').offset().top - $('header').height() }); }); }*/ var $nav = $('.cy_inside-nav .nav'); if ($nav.length) { var $nav_link = $nav.find('a'); var _pathname = location.pathname; $nav_link.click(function () { var hash = this.hash, pathname = this.pathname; if (hash.length) { if (pathname === _pathname) { var valh = $('.header').height(); smoothscroll($(this.hash), valh); } } }); } }, setvideo: function () { var $video = $('.video_cy'); if ($video.length) { $video.each(function () { var $this = $(this); $this.find('.vbbox .vicobox').on({ click: function () { if ($(".videobox #videobox").length) { $('#videobox').remove(); } else { $('.videobox').append('
'); $(".vwrap").fadein(); } cyplayer.load({ vcontainer: 'videobox', vfiles: $(this).data("video"), vfimg: $(this).data("img"), repeat:"false", isautoplay: "true" }); } }); }); $(".vwrap .close,.vwrap .videobtg").on({ click: function () { $(".vwrap").hide(function () { $('#videobox').remove(); }); } }); } var $brandvideo = $('.brand_video'); if ($brandvideo.length) { var $carousel = $brandvideo.find('.carousel'); $carousel.slick({ prevarrow: $brandvideo.find('.carousel-arrows .prev'), nextarrow: $brandvideo.find('.carousel-arrows .next'), swipe: false, dots: true, appenddots: $brandvideo.find('.carousel-dots'), custompaging: function() {return "";} }); } }, sethome: function () { var $banner = $('.hm-banner'); if ($banner.length) { var $carousel = $('.hm-banner .carousel'), $dots = $('.hm-banner .dots'); $carousel.on('init', function () { $dots.find('li').eq(0).addclass('cur'); }); $carousel.slick({ autoplay: true, autoplayspeed: 5000, speed: 600, arrows: false, dots: true, appenddots: $dots, fade: true, pauseonfocus: false, pauseonhover: false, custompaging: function(slider, i) {return i+1;} }).on({ 'afterchange': function (event, slick, currentslide) { var _item = $dots.find('li'); _item.eq(currentslide).addclass("cur").siblings().removeclass("cur"); } }); } $('.cy-tg').each(function () { var $this = $(this); if (!$this.hasclass('act')) { $this.addclass('act'); } }); }, sethonor: function () { var $honor = $('.a_honor-info'); if ($honor.length) { var $carousel = $honor.find('.carousel'); $carousel.slick({ prevarrow: $honor.find('.carousel-arrows .prev'), nextarrow: $honor.find('.carousel-arrows .next'), slidestoshow: 5, swipe: false, responsive: [ { breakpoint: 1241, settings: { slidestoshow: 4 } }, { breakpoint: 1025, settings: { slidestoshow: 3 } }, { breakpoint: 577, settings: { slidestoshow: 2 } }, { breakpoint: 426, settings: { slidestoshow: 1 } }] }); } }, setspeech: function () { var $speech = $('#speech-scroll'); if ($speech.length) { $speech.mcustomscrollbar({ theme: "rounded-dots", scrollinertia: 500 }); } }, sethr: function () { var $hr = $('.about_hr'); if ($hr.length) { var $link = $hr.find('.hr-info a'); $link.click(function (ev) { ev.preventdefault(); var $this = $(this); var _src = $this.attr('href'); var _body = $('.hr-body'); var $icon = $this.find('.icon'), $name = $this.find('.name'); if (_body.length) { _body.remove(); } $this.addclass('act'); $.ajax({ url: _src, datatype: "html", success: function (data) { var $_content = $(data).find('.hr-body'); $body.append($_content); var $_body = $('.hr-body'), $_icon = $_body.find('.hr_c-icon'), $_name = $_body.find('.hr_c-name'); $_icon.replacewith($icon.clone()); $_name.replacewith($name.clone()); $_body.fadein().addclass('show'); $content.addclass('overflow'); $header.addclass('scrollbar'); $view.addclass('scrollbar'); function hide() { $_body.addclass('hide').fadeout(function () { $content.removeclass('overflow'); $header.removeclass('scrollbar'); $view.removeclass('scrollbar'); $_body.remove(); $this.removeclass('act'); }); } $_body.click(function (ev) { if ($(ev.target).is($_body) || $(ev.target).is('.container')) { hide(); } }); $('.hr-body .icon-close').click(function () { hide(); }); } }); }); } }, sethistory: function () { var $history = $('.brand_history'); if ($history.length) { var $bhcontent = $('.bh-content'), $carousel = $bhcontent.find('.carousel'); var $line_s = $('.bh_line .line2'), $line = $('.bh_line .line1'), $dot = $('.bh_line .dots'); var _date = [[0, -74],[82, -84],[140, 48], [175, -40], [225, 50], [320, 140], [400, 250], [460, 160], [550, 100], [630, -15], [720, 280], [790, 330], [850, 690], [910, 350], [970, 400], [1040, 180], [1110, 350], [1200, 460], [1290, 560], [1290, 580], [1290, 600]]; $carousel.find('.carousel-item').each(function () { var $this = $(this), $date = $this.find('.date'); var i = $this.index(); $dot.append('' + $date.text() + '') }); $line.css('height', _date[$carousel.find('.carousel-item').last().index()][0] + $win.height()*2/3); $carousel.slick({ prevarrow: $bhcontent.find('.carousel-arrows .prev'), nextarrow: $bhcontent.find('.carousel-arrows .next'), swipe: false, fade: true, speed: 0, adaptiveheight: true, infinite: false }); $dot.find('span').each(function () { var $this = $(this); $this.click(function () { $carousel.slick('slickgoto', $this.index()); }); }); var _bhotop = $bhcontent.offset().top; var _index = 0; var _fixedtop = $history.offset().top - $header.height(); function bhscroll() { var _eletop = $history.offset().top - $header.height(), _srltop = $win.scrolltop(), _elebtm = $history.offset().top + $history.height() + $bhcontent.height() - $header.height(), _srlbtm = $win.scrolltop() + $win.height(), _clitop = _eletop - _srltop, _clibtm = _elebtm - _srlbtm; if (_clitop < 0) { $bhcontent.addclass('fixed').css({ top: _bhotop - _fixedtop }); if (_clibtm < 0) { if (_srltop > _elebtm) { $bhcontent.removeclass('fixed').css({top: ''}); } else { $bhcontent.css({top: _bhotop - _fixedtop + _clibtm}); } } } else { $bhcontent.removeclass('fixed').css({top: ''}); _fixedtop = _srltop; } var _linetop = $line_s.offset().top - $header.height() - $win.height()*2/3; if (_srltop > _linetop) { $line_s.css('height',(_srltop - _linetop)); if ($line_s.height() > $line.height()) { $line_s.css('height', $line.height()); } } else { $line_s.css('height', ''); } $dot.find('span').each(function () { var $this = $(this); var _top = $this.position().top + $dot.position().top; if ($line_s.height() > _top) { _index = $this.index(); } }); $carousel.slick('slickgoto', _index); } $win.scroll(function () { bhscroll(); }); } }, setdialog: function () { var $dialogbtn = $('.dialog_cy-btn'); if ($dialogbtn.length) { var $dialog = $('.dialog_cy'), $dialogitem = $dialog.find('.dialog-c_item'), $btn = $dialogbtn.find('.dialog-btn'), $servicesystem = $('.service_system'); $btn.click(function () { var $this = $(this); $this.addclass('act'); $servicesystem.addclass('show_dialog'); $dialog.fadein().addclass('show'); $dialogitem.eq($this.index()).addclass('z'); $content.addclass('overflow'); $header.addclass('scrollbar'); $view.addclass('scrollbar'); }); $dialog.click(function (ev) { if ($(ev.target).is($dialog) || $(ev.target).is('.dialog-content')) { hide(); } }); $dialog.find('.icon-close').click(function () { hide(); }); function hide() { $dialog.addclass('hide').fadeout(function () { $servicesystem.removeclass('show_dialog'); $content.removeclass('overflow'); $header.removeclass('scrollbar'); $view.removeclass('scrollbar'); $dialog.removeclass('show hide'); $dialogitem.removeclass('z'); $btn.removeclass('act'); }); } } }, setservice: function () { var $serviceadviser = $('.service_adviser'); if ($serviceadviser.length) { var $aitem = $serviceadviser.find('.a-i_item'); $aitem.each(function () { var $this = $(this), $title = $this.find('.a-i_head'), $cont = $this.find('.a-i_body'); $title.click(function () { $this.toggleclass('act'); $cont.stop().slidetoggle(); }); }); } var $serviceby = $('.service_by'); if ($serviceby.length) { var $tabbtn = $('.tab-btn .t-b_item'), $tabcontent = $('.tab-content .t-c_item'); $tabbtn.click(function () { var $this = $(this); $this.addclass('act').siblings().removeclass('act'); $tabcontent.eq($this.index()).addclass('act').siblings().removeclass('act'); }); } var $joindata = $('.join-data'); if ($joindata.length) { var $carousel = $joindata.find('.carousel'), $dots = $joindata.find('.carousel-dots'); $carousel.slick({ arrows: false, dots: true, appenddots: $dots, pauseonfocus: false, pauseonhover: false, custompaging: function() {return '';}, slidestoshow: 4, slidestoscroll: 4, infinite: false, responsive: [ { breakpoint: 1241, settings: { slidestoshow: 3, slidestoscroll: 3 } }, { breakpoint: 769, settings: { slidestoshow: 2, slidestoscroll: 2 } }, { breakpoint: 426, settings: { slidestoshow: 1, slidestoscroll: 1 } }] }); } }, setmore: function () { /*var $sidenav = $('.side-nav'); if ($sidenav.length) { var $totop = $sidenav.find('.to-top'); $totop.click(function () { $content.stop().animate({scrolltop: 0}); }); $win.scroll(function () { if ($win.scrolltop() > $win.height()/2) { $totop.addclass('s'); } else { $totop.removeclass('s') } }); }*/ var $banner = $('.banner_para'); if ($banner.length) { if ($win.width() > 1024) { $win.scroll(function () { if ($win.scrolltop()<$banner.height()) { $banner.find('.banner-pic .pic').css({ 'background-position-y': math.round(($win.scrolltop()/$banner.height())*($win.height()/3))+'px' }); } }); } } var $para = $('.cy_para'); if ($para.length) { cy_step=($(window).width() > 1024)?30:''; $(window).resize(function () { cy_step=($(window).width() > 1024)?30:''; }); var init_index = 0, // init_top = $para.first().offset().top, init_btm = $para.first().offset().top + $para.first().outerheight(); $win.scroll(function () { para(); }); function para() { if ($win.width() > 1024) { // var scroll_top = $win.scrolltop(); var scrollbtm = $win.scrolltop()+$win.height(); $para.each(function (index) { var $this = $(this); // var _top = $this.offset().top; var _btm = $this.offset().top+$this.outerheight(); // if (scroll_top > _top) { if (scrollbtm > _btm) { init_index = index; // init_top = _top; init_btm = _btm; } }); // var scroll_h = parseint(scroll_top - init_top); var scroll_h = parseint(scrollbtm - init_btm); // if (scroll_top > init_top) { if (scrollbtm > init_btm) { $para.eq(init_index+1).css({ 'margin-top': -math.round(scroll_h * .7) + 'px' }); $para.eq(init_index-1).removeclass('cy_cur'); $para.eq(init_index).addclass('cy_cur'); $para.eq(init_index+1).addclass('cy_cur'); $para.eq(init_index+2).removeclass('cy_cur'); } else { $para.css('margin-top', '').removeclass('cy_cur'); } } else { $para.css('margin-top', '').removeclass('cy_cur'); } } } }, setsmooth: function () { (function(){var defaultoptions={framerate:150,animationtime:700,stepsize:cy_step||120,pulsealgorithm:true,pulsescale:8,pulsenormalize:1,accelerationdelta:20,accelerationmax:1,keyboardsupport:true,arrowscroll:50,fixedbackground:true,excluded:''};var options=defaultoptions;var isexcluded=false;var isframe=false;var direction={x:0,y:0};var initdone=false;var root=document.documentelement;var activeelement;var observer;var refreshsize;var deltabuffer=[];var ismac=/^mac/.test(navigator.platform);var key={left:37,up:38,right:39,down:40,spacebar:32,pageup:33,pagedown:34,end:35,home:36};var arrowkeys={37:1,38:1,39:1,40:1};function inittest(){if(options.keyboardsupport){addevent('keydown',keydown)}}function init(){if(initdone||!document.body)return;initdone=true;var body=document.body;var html=document.documentelement;var windowheight=window.innerheight;var scrollheight=body.scrollheight;root=(document.compatmode.indexof('css')>=0)?html:body;activeelement=body;inittest();if(top!=self){isframe=true}else if(isoldsafari&&scrollheight>windowheight&&(body.offsetheight<=windowheight||html.offsetheight<=windowheight)){var fullpageelem=document.createelement('div');fullpageelem.style.csstext='position:absolute; z-index:-10000; top:0; left:0; right:0; height:'+root.scrollheight+'px';document.body.appendchild(fullpageelem);var pendingrefresh;refreshsize=function(){if(pendingrefresh)return;pendingrefresh=settimeout(function(){if(isexcluded)return;fullpageelem.style.height='0';fullpageelem.style.height=root.scrollheight+'px';pendingrefresh=null},500)};settimeout(refreshsize,10);addevent('resize',refreshsize);var config={attributes:true,childlist:true,characterdata:false};observer=new mutationobserver(refreshsize);observer.observe(body,config);if(root.offsetheight<=windowheight){var clearfix=document.createelement('div');clearfix.style.clear='both';body.appendchild(clearfix)}}if(!options.fixedbackground&&!isexcluded){body.style.backgroundattachment='scroll';html.style.backgroundattachment='scroll'}}function cleanup(){observer&&observer.disconnect();removeevent(wheelevent,wheel);removeevent('mousedown',mousedown);removeevent('keydown',keydown);removeevent('resize',refreshsize);removeevent('load',init)}var que=[];var pending=false;var lastscroll=date.now();function scrollarray(elem,left,top){directioncheck(left,top);if(options.accelerationmax!=1){var now=date.now();var elapsed=now-lastscroll;if(elapsed1){factor=math.min(factor,options.accelerationmax);left*=factor;top*=factor}}lastscroll=date.now()}que.push({x:left,y:top,lastx:(left<0)?0.99:-0.99,lasty:(top<0)?0.99:-0.99,start:date.now()});if(pending){return}var scrollwindow=(elem===document.body);var step=function(time){var now=date.now();var scrollx=0;var scrolly=0;for(var i=0;i=options.animationtime);var position=(finished)?1:elapsed/options.animationtime;if(options.pulsealgorithm){position=pulse(position)}var x=(item.x*position-item.lastx)>>0;var y=(item.y*position-item.lasty)>>0;scrollx+=x;scrolly+=y;item.lastx+=x;item.lasty+=y;if(finished){que.splice(i,1);i--}}if(scrollwindow){window.scrollby(scrollx,scrolly)}else{if(scrollx)elem.scrollleft+=scrollx;if(scrolly)elem.scrolltop+=scrolly}if(!left&&!top){que=[]}if(que.length){requestframe(step,elem,(1000/options.framerate+1))}else{pending=false}};requestframe(step,elem,0);pending=true}function wheel(event){if(!initdone){init()}var target=event.target;if(event.defaultprevented||event.ctrlkey){return true}if(isnodename(activeelement,'embed')||(isnodename(target,'embed')&&/\.pdf/i.test(target.src))||isnodename(activeelement,'object')||target.shadowroot){return true}var deltax=-event.wheeldeltax||event.deltax||0;var deltay=-event.wheeldeltay||event.deltay||0;if(ismac){if(event.wheeldeltax&&isdivisible(event.wheeldeltax,120)){deltax=-120*(event.wheeldeltax/math.abs(event.wheeldeltax))}if(event.wheeldeltay&&isdivisible(event.wheeldeltay,120)){deltay=-120*(event.wheeldeltay/math.abs(event.wheeldeltay))}}if(!deltax&&!deltay){deltay=-event.wheeldelta||0}if(event.deltamode===1){deltax*=40;deltay*=40}var overflowing=overflowingancestor(target);if(!overflowing){if(isframe&&ischrome){object.defineproperty(event,"target",{value:window.frameelement});return parent.wheel(event)}return true}if(istouchpad(deltay)){return true}if(math.abs(deltax)>1.2){deltax*=options.stepsize/120}if(math.abs(deltay)>1.2){deltay*=options.stepsize/120}scrollarray(overflowing,deltax,deltay);event.preventdefault();scheduleclearcache()}function keydown(event){var target=event.target;var modifier=event.ctrlkey||event.altkey||event.metakey||(event.shiftkey&&event.keycode!==key.spacebar);if(!document.body.contains(activeelement)){activeelement=document.activeelement}var inputnodenames=/^(textarea|select|embed|object)$/i;var buttontypes=/^(button|submit|radio|checkbox|file|color|image)$/i;if(event.defaultprevented||inputnodenames.test(target.nodename)||isnodename(target,'input')&&!buttontypes.test(target.type)||isnodename(activeelement,'video')||isinsideyoutubevideo(event)||target.iscontenteditable||modifier){return true}if((isnodename(target,'button')||isnodename(target,'input')&&buttontypes.test(target.type))&&event.keycode===key.spacebar){return true}if(isnodename(target,'input')&&target.type=='radio'&&arrowkeys[event.keycode]){return true}var shift,x=0,y=0;var overflowing=overflowingancestor(activeelement);if(!overflowing){return(isframe&&ischrome)?parent.keydown(event):true}var clientheight=overflowing.clientheight;if(overflowing==document.body){clientheight=window.innerheight}switch(event.keycode){case key.up:y=-options.arrowscroll;break;case key.down:y=options.arrowscroll;break;case key.spacebar:shift=event.shiftkey?1:-1;y=-shift*clientheight*0.9;break;case key.pageup:y=-clientheight*0.9;break;case key.pagedown:y=clientheight*0.9;break;case key.home:y=-overflowing.scrolltop;break;case key.end:var scroll=overflowing.scrollheight-overflowing.scrolltop;var scrollremaining=scroll-clientheight;y=(scrollremaining>0)?scrollremaining+10:0;break;case key.left:x=-options.arrowscroll;break;case key.right:x=options.arrowscroll;break;default:return true}scrollarray(overflowing,x,y);event.preventdefault();scheduleclearcache()}function mousedown(event){activeelement=event.target}var uniqueid=(function(){var i=0;return function(el){return el.uniqueid||(el.uniqueid=i++)}})();var cache={};var clearcachetimer;function scheduleclearcache(){cleartimeout(clearcachetimer);clearcachetimer=setinterval(function(){cache={}},1*1000)}function setcache(elems,overflowing){for(var i=elems.length;i--;)cache[uniqueid(elems[i])]=overflowing;return overflowing}function overflowingancestor(el){var elems=[];var body=document.body;var rootscrollheight=root.scrollheight;do{var cached=cache[uniqueid(el)];if(cached){return setcache(elems,cached)}elems.push(el);if(rootscrollheight===el.scrollheight){var topoverflowsnothidden=overflownothidden(root)&&overflownothidden(body);var isoverflowcss=topoverflowsnothidden||overflowautoorscroll(root);if(isframe&&iscontentoverflowing(root)||!isframe&&isoverflowcss){return setcache(elems,getscrollroot())}}else if(iscontentoverflowing(el)&&overflowautoorscroll(el)){return setcache(elems,el)}}while(el=el.parentelement)}function iscontentoverflowing(el){return(el.clientheight+100)?1:-1;y=(y>0)?1:-1;if(direction.x!==x||direction.y!==y){direction.x=x;direction.y=y;que=[];lastscroll=0}}var deltabuffertimer;if(window.localstorage&&localstorage.ss_deltabuffer){try{deltabuffer=localstorage.ss_deltabuffer.split(',')}catch(e){}}function istouchpad(deltay){if(!deltay)return;if(!deltabuffer.length){deltabuffer=[deltay,deltay,deltay]}deltay=math.abs(deltay);deltabuffer.push(deltay);deltabuffer.shift();cleartimeout(deltabuffertimer);deltabuffertimer=settimeout(function(){try{localstorage.ss_deltabuffer=deltabuffer.join(',')}catch(e){}},1000);return!alldeltasdivisableby(120)&&!alldeltasdivisableby(100)}function isdivisible(n,divisor){return(math.floor(n/divisor)==n/divisor)}function alldeltasdivisableby(divisor){return(isdivisible(deltabuffer[0],divisor)&&isdivisible(deltabuffer[1],divisor)&&isdivisible(deltabuffer[2],divisor))}function isinsideyoutubevideo(event){var elem=event.target;var iscontrol=false;if(document.url.indexof('www.youtube.com/watch')!=-1){do{iscontrol=(elem.classlist&&elem.classlist.contains('html5-video-controls'));if(iscontrol)break}while(elem=elem.parentnode)}return iscontrol}var requestframe=(function(){return(window.requestanimationframe||window.webkitrequestanimationframe||window.mozrequestanimationframe||function(callback,element,delay){window.settimeout(callback,delay||(1000/60))})})();var mutationobserver=(window.mutationobserver||window.webkitmutationobserver||window.mozmutationobserver);var getscrollroot=(function(){var scroll_root;return function(){if(!scroll_root){var dummy=document.createelement('div');dummy.style.csstext='height:10000px;width:1px;';document.body.appendchild(dummy);var bodyscrolltop=document.body.scrolltop;var docelscrolltop=document.documentelement.scrolltop;window.scrollby(0,3);if(document.body.scrolltop!=bodyscrolltop)(scroll_root=document.body);else(scroll_root=document.documentelement);window.scrollby(0,-3);document.body.removechild(dummy)}return scroll_root}})();function pulse_(x){var val,start,expx;x=x*options.pulsescale;if(x<1){val=x-(1-math.exp(-x))}else{start=math.exp(-1);x-=1;expx=1-math.exp(-x);val=start+(expx*(1-start))}return val*options.pulsenormalize}function pulse(x){if(x>=1)return 1;if(x<=0)return 0;if(options.pulsenormalize==1){options.pulsenormalize/=pulse_(1)}return pulse_(x)}var useragent=window.navigator.useragent;var isedge=/edge/.test(useragent);var ischrome=/chrome/i.test(useragent)&&!isedge;var issafari=/safari/i.test(useragent)&&!isedge;var ismobile=/mobile/i.test(useragent);var isiewin7=/windows nt 6.1/i.test(useragent)&&/rv:11/i.test(useragent);var isoldsafari=issafari&&(/version\/8/i.test(useragent)||/version\/9/i.test(useragent));var isenabledforbrowser=(ischrome||issafari||isiewin7)&&!ismobile;var wheelevent;if('onwheel'in document.createelement('div'))wheelevent='wheel';else if('onmousewheel'in document.createelement('div'))wheelevent='mousewheel';if(wheelevent&&isenabledforbrowser){addevent(wheelevent,wheel);addevent('mousedown',mousedown);addevent('load',init)}function smoothscroll(optionstoset){for(var key in optionstoset)if(defaultoptions.hasownproperty(key))options[key]=optionstoset[key]}smoothscroll.destroy=cleanup;if(window.smoothscrolloptions)smoothscroll(window.smoothscrolloptions);if(typeof define==='function'&&define.amd)define(function(){return smoothscroll});else if('object'==typeof exports)module.exports=smoothscroll;else window.smoothscroll=smoothscroll})(); } }; function smoothscroll(target, h, time) { $content.animate({ scrolltop: target.offset().top - (h || 0) }, (time || 500)); } $(function () { cy.init(); }); // 底部select $(".fs-select").click(function() { $(".fs-zk").slidetoggle(300); }).mouseleave(function() { $(".fs-zk").slideup(300); });