/*! * customized version of iscroll.js 0.0.1 * it fixes bugs affecting its integration with fullpage.js */ /*! iscroll v5.2.0 ~ (c) 2008-2016 matteo spinelli ~ http://cubiq.org/license */ (function(g,q,f){function p(a,b){this.wrapper="string"==typeof a?q.queryselector(a):a;this.scroller=this.wrapper.children[0];this.scrollerstyle=this.scroller.style;this.options={resizescrollbars:!0,mousewheelspeed:20,snapthreshold:.334,disablepointer:!d.haspointer,disabletouch:d.haspointer||!d.hastouch,disablemouse:d.haspointer||d.hastouch,startx:0,starty:0,scrolly:!0,directionlockthreshold:5,momentum:!0,bounce:!0,bouncetime:600,bounceeasing:"",preventdefault:!0,preventdefaultexception:{tagname:/^(input|textarea|button|select|label)$/}, hwcompositing:!0,usetransition:!0,usetransform:!0,bindtowrapper:"undefined"===typeof g.onmousedown};for(var c in b)this.options[c]=b[c];this.translatez=this.options.hwcompositing&&d.hasperspective?" translatez(0)":"";this.options.usetransition=d.hastransition&&this.options.usetransition;this.options.usetransform=d.hastransform&&this.options.usetransform;this.options.eventpassthrough=!0===this.options.eventpassthrough?"vertical":this.options.eventpassthrough;this.options.preventdefault=!this.options.eventpassthrough&& this.options.preventdefault;this.options.scrolly="vertical"==this.options.eventpassthrough?!1:this.options.scrolly;this.options.scrollx="horizontal"==this.options.eventpassthrough?!1:this.options.scrollx;this.options.freescroll=this.options.freescroll&&!this.options.eventpassthrough;this.options.directionlockthreshold=this.options.eventpassthrough?0:this.options.directionlockthreshold;this.options.bounceeasing="string"==typeof this.options.bounceeasing?d.ease[this.options.bounceeasing]||d.ease.circular: this.options.bounceeasing;this.options.resizepolling=void 0===this.options.resizepolling?60:this.options.resizepolling;!0===this.options.tap&&(this.options.tap="tap");this.options.usetransition||this.options.usetransform||/relative|absolute/i.test(this.scrollerstyle.position)||(this.scrollerstyle.position="relative");"scale"==this.options.shrinkscrollbars&&(this.options.usetransition=!1);this.options.invertwheeldirection=this.options.invertwheeldirection?-1:1;this.directiony=this.directionx=this.y= this.x=0;this._events={};this._init();this.refresh();this.scrollto(this.options.startx,this.options.starty);this.enable()}function u(a,b,c){var e=q.createelement("div"),d=q.createelement("div");!0===c&&(e.style.csstext="position:absolute;z-index:9999",d.style.csstext="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px");d.classname="iscrollindicator";"h"==a?(!0===c&&(e.style.csstext+= ";height:7px;left:2px;right:2px;bottom:0",d.style.height="100%"),e.classname="iscrollhorizontalscrollbar"):(!0===c&&(e.style.csstext+=";width:7px;bottom:2px;top:2px;right:1px",d.style.width="100%"),e.classname="iscrollverticalscrollbar");e.style.csstext+=";overflow:hidden";b||(e.style.pointerevents="none");e.appendchild(d);return e}function v(a,b){this.wrapper="string"==typeof b.el?q.queryselector(b.el):b.el;this.wrapperstyle=this.wrapper.style;this.indicator=this.wrapper.children[0];this.indicatorstyle= this.indicator.style;this.scroller=a;this.options={listenx:!0,listeny:!0,interactive:!1,resize:!0,defaultscrollbars:!1,shrink:!1,fade:!1,speedratiox:0,speedratioy:0};for(var c in b)this.options[c]=b[c];this.sizeratioy=this.sizeratiox=1;this.maxposy=this.maxposx=0;this.options.interactive&&(this.options.disabletouch||(d.addevent(this.indicator,"touchstart",this),d.addevent(g,"touchend",this)),this.options.disablepointer||(d.addevent(this.indicator,d.prefixpointerevent("pointerdown"),this),d.addevent(g, d.prefixpointerevent("pointerup"),this)),this.options.disablemouse||(d.addevent(this.indicator,"mousedown",this),d.addevent(g,"mouseup",this)));if(this.options.fade){this.wrapperstyle[d.style.transform]=this.scroller.translatez;var e=d.style.transitionduration;if(e){this.wrapperstyle[e]=d.isbadandroid?"0.0001ms":"0ms";var f=this;d.isbadandroid&&t(function(){"0.0001ms"===f.wrapperstyle[e]&&(f.wrapperstyle[e]="0s")});this.wrapperstyle.opacity="0"}}}var t=g.requestanimationframe||g.webkitrequestanimationframe|| g.mozrequestanimationframe||g.orequestanimationframe||g.msrequestanimationframe||function(a){g.settimeout(a,1e3/60)},d=function(){function a(a){return!1===e?!1:""===e?a:e+a.charat(0).touppercase()+a.substr(1)}var b={},c=q.createelement("div").style,e=function(){for(var a=["t","webkitt","mozt","mst","ot"],b,e=0,d=a.length;eb?-1:1);k=c/k;gparsefloat(a[1]):!0:!1}();b.extend(b.style={},{transform:d,transitiontimingfunction:a("transitiontimingfunction"),transitionduration:a("transitionduration"), transitiondelay:a("transitiondelay"),transformorigin:a("transformorigin")});b.hasclass=function(a,b){return(new regexp("(^|\\s)"+b+"(\\s|$)")).test(a.classname)};b.addclass=function(a,c){if(!b.hasclass(a,c)){var e=a.classname.split(" ");e.push(c);a.classname=e.join(" ")}};b.removeclass=function(a,c){b.hasclass(a,c)&&(a.classname=a.classname.replace(new regexp("(^|\\s)"+c+"(\\s|$)","g")," "))};b.offset=function(a){for(var b=-a.offsetleft,c=-a.offsettop;a=a.offsetparent;)b-=a.offsetleft,c-=a.offsettop; return{left:b,top:c}};b.preventdefaultexception=function(a,b){for(var c in b)if(b[c].test(a[c]))return!0;return!1};b.extend(b.eventtype={},{touchstart:1,touchmove:1,touchend:1,mousedown:2,mousemove:2,mouseup:2,pointerdown:3,pointermove:3,pointerup:3,mspointerdown:3,mspointermove:3,mspointerup:3});b.extend(b.ease={},{quadratic:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(a){return a*(2-a)}},circular:{style:"cubic-bezier(0.1, 0.57, 0.1, 1)",fn:function(a){return f.sqrt(1- --a*a)}},back:{style:"cubic-bezier(0.175, 0.885, 0.32, 1.275)", fn:function(a){return--a*a*(5*a+4)+1}},bounce:{style:"",fn:function(a){return(a/=1)<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}},elastic:{style:"",fn:function(a){return 0===a?0:1==a?1:.4*f.pow(2,-10*a)*f.sin(2*(a-.055)*f.pi/.22)+1}}});b.tap=function(a,b){var c=q.createevent("event");c.initevent(b,!0,!0);c.pagex=a.pagex;c.pagey=a.pagey;a.target.dispatchevent(c)};b.click=function(a){var b=a.target,c;/(select|input|textarea)/i.test(b.tagname)|| (c=q.createevent(g.mouseevent?"mouseevents":"event"),c.initevent("click",!0,!0),c.view=a.view||g,c.detail=1,c.screenx=b.screenx||0,c.screeny=b.screeny||0,c.clientx=b.clientx||0,c.clienty=b.clienty||0,c.ctrlkey=!!a.ctrlkey,c.altkey=!!a.altkey,c.shiftkey=!!a.shiftkey,c.metakey=!!a.metakey,c.button=0,c.relatedtarget=null,c._constructed=!0,b.dispatchevent(c))};return b}();p.prototype={version:"5.2.0",_init:function(){this._initevents();(this.options.scrollbars||this.options.indicators)&&this._initindicators(); this.options.mousewheel&&this._initwheel();this.options.snap&&this._initsnap();this.options.keybindings&&this._initkeys()},destroy:function(){this._initevents(!0);cleartimeout(this.resizetimeout);this.resizetimeout=null;this._execevent("destroy")},_transitionend:function(a){a.target==this.scroller&&this.isintransition&&(this._transitiontime(),this.resetposition(this.options.bouncetime)||(this.isintransition=!1,this._execevent("scrollend")))},_start:function(a){if(!(1!=d.eventtype[a.type]&&0!==(a.which? a.button:2>a.button?0:4==a.button?1:2)||!this.enabled||this.initiated&&d.eventtype[a.type]!==this.initiated)){!this.options.preventdefault||d.isbadandroid||d.preventdefaultexception(a.target,this.options.preventdefaultexception)||a.preventdefault();var b=a.touches?a.touches[0]:a;this.initiated=d.eventtype[a.type];this.moved=!1;this.directionlocked=this.directiony=this.directionx=this.disty=this.distx=0;this.starttime=d.gettime();this.options.usetransition&&this.isintransition?(this._transitiontime(), this.isintransition=!1,a=this.getcomputedposition(),this._translate(f.round(a.x),f.round(a.y)),this._execevent("scrollend")):!this.options.usetransition&&this.isanimating&&(this.isanimating=!1,this._execevent("scrollend"));this.startx=this.x;this.starty=this.y;this.absstartx=this.x;this.absstarty=this.y;this.pointx=b.pagex;this.pointy=b.pagey;this._execevent("beforescrollstart")}},_move:function(a){if(this.enabled&&d.eventtype[a.type]===this.initiated){this.options.preventdefault&&a.preventdefault(); var b=a.touches?a.touches[0]:a,c=b.pagex-this.pointx,e=b.pagey-this.pointy,k=d.gettime(),h;this.pointx=b.pagex;this.pointy=b.pagey;this.distx+=c;this.disty+=e;b=f.abs(this.distx);h=f.abs(this.disty);if(!(300b&&10>h)){this.directionlocked||this.options.freescroll||(this.directionlocked=b>h+this.options.directionlockthreshold?"h":h>=b+this.options.directionlockthreshold?"v":"n");if("h"==this.directionlocked){if("vertical"==this.options.eventpassthrough)a.preventdefault();else if("horizontal"== this.options.eventpassthrough){this.initiated=!1;return}e=0}else if("v"==this.directionlocked){if("horizontal"==this.options.eventpassthrough)a.preventdefault();else if("vertical"==this.options.eventpassthrough){this.initiated=!1;return}c=0}c=this.hashorizontalscroll?c:0;e=this.hasverticalscroll?e:0;a=this.x+c;b=this.y+e;if(0c?1:0;this.directiony=0e?1:0;this.moved||this._execevent("scrollstart");this.moved=!0;this._translate(a,b);300c&&100>h&&100>g)this._execevent("flick");else if(this.options.momentum&&300>c&&(b=this.hashorizontalscroll?d.momentum(this.x,this.startx,c,this.maxscrollx,this.options.bounce?this.wrapperwidth:0,this.options.deceleration):{destination:e,duration:0},c=this.hasverticalscroll?d.momentum(this.y,this.starty, c,this.maxscrolly,this.options.bounce?this.wrapperheight:0,this.options.deceleration):{destination:k,duration:0},e=b.destination,k=c.destination,b=f.max(b.duration,c.duration),this.isintransition=1),this.options.snap&&(this.currentpage=l=this._nearestsnap(e,k),b=this.options.snapspeed||f.max(f.max(f.min(f.abs(e-l.x),1e3),f.min(f.abs(k-l.y),1e3)),300),e=l.x,k=l.y,this.directiony=this.directionx=0,l=this.options.bounceeasing),e!=this.x||k!=this.y){if(0this.maxscrollx;this.hasverticalscroll=this.options.scrolly&&0>this.maxscrolly;this.hashorizontalscroll||(this.maxscrollx=0,this.scrollerwidth=this.wrapperwidth);this.hasverticalscroll||(this.maxscrolly=0,this.scrollerheight=this.wrapperheight);this.directiony=this.directionx=this.endtime=0;this.wrapperoffset=d.offset(this.wrapper);this._execevent("refresh");this.resetposition()},on:function(a,b){this._events[a]||(this._events[a]=[]);this._events[a].push(b)}, off:function(a,b){if(this._events[a]){var c=this._events[a].indexof(b);-1b&&c++,0a&&e++,this.gotopage(c,e)):(c=this.x+f.round(this.hashorizontalscroll?b:0),e=this.y+f.round(this.hasverticalscroll?a:0),this.directionx=0b?1:0,this.directiony=0a?1:0,0-this.scrollerwidth;){this.pages[a]=[];for(l=b=0;l>-this.scrollerheight;)this.pages[a][b]={x:f.max(n,this.maxscrollx),y:f.max(l, this.maxscrolly),width:e,height:m,cx:n-d,cy:l-g},l-=m,b++;n-=e;a++}else for(m=this.options.snap,b=m.length,e=-1;athis.maxscrollx&&c++}this.gotopage(this.currentpage.pagex|| 0,this.currentpage.pagey||0,0);0===this.options.snapthreshold%1?this.snapthresholdy=this.snapthresholdx=this.options.snapthreshold:(this.snapthresholdx=f.round(this.pages[this.currentpage.pagex][this.currentpage.pagey].width*this.options.snapthreshold),this.snapthresholdy=f.round(this.pages[this.currentpage.pagex][this.currentpage.pagey].height*this.options.snapthreshold))}});this.on("flick",function(){var a=this.options.snapspeed||f.max(f.max(f.min(f.abs(this.x-this.startx),1e3),f.min(f.abs(this.y- this.starty),1e3)),300);this.gotopage(this.currentpage.pagex+this.directionx,this.currentpage.pagey+this.directiony,a)})},_nearestsnap:function(a,b){if(!this.pages.length)return{x:0,y:0,pagex:0,pagey:0};var c=0,e=this.pages.length,d=0;if(f.abs(a-this.absstartx)=this.pages[c][0].cx){a=this.pages[c][0].x; break}for(e=this.pages[c].length;d=this.pages[0][d].cy){b=this.pages[0][d].y;break}c==this.currentpage.pagex&&(c+=this.directionx,0>c?c=0:c>=this.pages.length&&(c=this.pages.length-1),a=this.pages[c][0].x);d==this.currentpage.pagey&&(d+=this.directiony,0>d?d=0:d>=this.pages[0].length&&(d=this.pages[0].length-1),b=this.pages[0][d].y);return{x:a,y:b,pagex:c,pagey:d}},gotopage:function(a,b,c,d){d=d||this.options.bounceeasing;a>=this.pages.length?a=this.pages.length-1:0>a&&(a=0);b>=this.pages[a].length? b=this.pages[a].length-1:0>b&&(b=0);var g=this.pages[a][b].x,h=this.pages[a][b].y;c=void 0===c?this.options.snapspeed||f.max(f.max(f.min(f.abs(g-this.x),1e3),f.min(f.abs(h-this.y),1e3)),300):c;this.currentpage={x:g,y:h,pagex:a,pagey:b};this.scrollto(g,h,c,d)},next:function(a,b){var c=this.currentpage.pagex,d=this.currentpage.pagey;c++;c>=this.pages.length&&this.hasverticalscroll&&(c=0,d++);this.gotopage(c,d,a,b)},prev:function(a,b){var c=this.currentpage.pagex,d=this.currentpage.pagey;c--;0>c&&this.hasverticalscroll&& (c=0,d--);this.gotopage(c,d,a,b)},_initkeys:function(a){a={pageup:33,pagedown:34,end:35,home:36,left:37,up:38,right:39,down:40};var b;if("object"==typeof this.options.keybindings)for(b in this.options.keybindings)"string"==typeof this.options.keybindings[b]&&(this.options.keybindings[b]=this.options.keybindings[b].touppercase().charcodeat(0));else this.options.keybindings={};for(b in a)this.options.keybindings[b]=this.options.keybindings[b]||a[b];d.addevent(g,"keydown",this);this.on("destroy",function(){d.removeevent(g, "keydown",this)})},_key:function(a){if(this.enabled){var b=this.options.snap,c=b?this.currentpage.pagex:this.x,e=b?this.currentpage.pagey:this.y,g=d.gettime(),h=this.keytime||0,n;this.options.usetransition&&this.isintransition&&(n=this.getcomputedposition(),this._translate(f.round(n.x),f.round(n.y)),this.isintransition=!1);this.keyacceleration=200>g-h?f.min(this.keyacceleration+.25,50):0;switch(a.keycode){case this.options.keybindings.pageup:this.hashorizontalscroll&&!this.hasverticalscroll?c+=b? 1:this.wrapperwidth:e+=b?1:this.wrapperheight;break;case this.options.keybindings.pagedown:this.hashorizontalscroll&&!this.hasverticalscroll?c-=b?1:this.wrapperwidth:e-=b?1:this.wrapperheight;break;case this.options.keybindings.end:c=b?this.pages.length-1:this.maxscrollx;e=b?this.pages[0].length-1:this.maxscrolly;break;case this.options.keybindings.home:e=c=0;break;case this.options.keybindings.left:c+=b?-1:5+this.keyacceleration>>0;break;case this.options.keybindings.up:e+=b?1:5+this.keyacceleration>> 0;break;case this.options.keybindings.right:c-=b?-1:5+this.keyacceleration>>0;break;case this.options.keybindings.down:e-=b?1:5+this.keyacceleration>>0;break;default:return}b?this.gotopage(c,e):(0=q?(g.isanimating=!1,g._translate(a, b),g.resetposition(g.options.bouncetime)||g._execevent("scrollend")):(r=(r-m)/c,p=e(r),r=(a-n)*p+n,p=(b-l)*p+l,g._translate(r,p),g.isanimating&&t(f))}var g=this,n=this.x,l=this.y,m=d.gettime(),q=m+c;this.isanimating=!0;f()},handleevent:function(a){switch(a.type){case "touchstart":case "pointerdown":case "mspointerdown":case "mousedown":this._start(a);break;case "touchmove":case "pointermove":case "mspointermove":case "mousemove":this._move(a);break;case "touchend":case "pointerup":case "mspointerup":case "mouseup":case "touchcancel":case "pointercancel":case "mspointercancel":case "mousecancel":this._end(a); break;case "orientationchange":case "resize":this._resize();break;case "transitionend":case "webkittransitionend":case "otransitionend":case "mstransitionend":this._transitionend(a);break;case "wheel":case "dommousescroll":case "mousewheel":this._wheel(a);break;case "keydown":this._key(a);break;case "click":this.enabled&&!a._constructed&&(a.preventdefault(),a.stoppropagation())}}};v.prototype={handleevent:function(a){switch(a.type){case "touchstart":case "pointerdown":case "mspointerdown":case "mousedown":this._start(a); break;case "touchmove":case "pointermove":case "mspointermove":case "mousemove":this._move(a);break;case "touchend":case "pointerup":case "mspointerup":case "mouseup":case "touchcancel":case "pointercancel":case "mspointercancel":case "mousecancel":this._end(a)}},destroy:function(){this.options.fadescrollbars&&(cleartimeout(this.fadetimeout),this.fadetimeout=null);this.options.interactive&&(d.removeevent(this.indicator,"touchstart",this),d.removeevent(this.indicator,d.prefixpointerevent("pointerdown"), this),d.removeevent(this.indicator,"mousedown",this),d.removeevent(g,"touchmove",this),d.removeevent(g,d.prefixpointerevent("pointermove"),this),d.removeevent(g,"mousemove",this),d.removeevent(g,"touchend",this),d.removeevent(g,d.prefixpointerevent("pointerup"),this),d.removeevent(g,"mouseup",this));this.options.defaultscrollbars&&this.wrapper.parentnode.removechild(this.wrapper)},_start:function(a){var b=a.touches?a.touches[0]:a;a.preventdefault();a.stoppropagation();this.transitiontime();this.initiated= !0;this.moved=!1;this.lastpointx=b.pagex;this.lastpointy=b.pagey;this.starttime=d.gettime();this.options.disabletouch||d.addevent(g,"touchmove",this);this.options.disablepointer||d.addevent(g,d.prefixpointerevent("pointermove"),this);this.options.disablemouse||d.addevent(g,"mousemove",this);this.scroller._execevent("beforescrollstart")},_move:function(a){var b=a.touches?a.touches[0]:a,c,e;d.gettime();this.moved||this.scroller._execevent("scrollstart");this.moved=!0;c=b.pagex-this.lastpointx;this.lastpointx= b.pagex;e=b.pagey-this.lastpointy;this.lastpointy=b.pagey;this._pos(this.x+c,this.y+e);a.preventdefault();a.stoppropagation()},_end:function(a){if(this.initiated){this.initiated=!1;a.preventdefault();a.stoppropagation();d.removeevent(g,"touchmove",this);d.removeevent(g,d.prefixpointerevent("pointermove"),this);d.removeevent(g,"mousemove",this);if(this.scroller.options.snap){a=this.scroller._nearestsnap(this.scroller.x,this.scroller.y);var b=this.options.snapspeed||f.max(f.max(f.min(f.abs(this.scroller.x- a.x),1e3),f.min(f.abs(this.scroller.y-a.y),1e3)),300);if(this.scroller.x!=a.x||this.scroller.y!=a.y)this.scroller.directionx=0,this.scroller.directiony=0,this.scroller.currentpage=a,this.scroller.scrollto(a.x,a.y,b,this.scroller.options.bounceeasing)}this.moved&&this.scroller._execevent("scrollend")}},transitiontime:function(a){a=a||0;var b=d.style.transitionduration;if(b&&(this.indicatorstyle[b]=a+"ms",!a&&d.isbadandroid)){this.indicatorstyle[b]="0.0001ms";var c=this;t(function(){"0.0001ms"===c.indicatorstyle[b]&& (c.indicatorstyle[b]="0s")})}},transitiontimingfunction:function(a){this.indicatorstyle[d.style.transitiontimingfunction]=a},refresh:function(){this.transitiontime();this.indicatorstyle.display=this.options.listenx&&!this.options.listeny?this.scroller.hashorizontalscroll?"block":"none":this.options.listeny&&!this.options.listenx?this.scroller.hasverticalscroll?"block":"none":this.scroller.hashorizontalscroll||this.scroller.hasverticalscroll?"block":"none";this.scroller.hashorizontalscroll&&this.scroller.hasverticalscroll? (d.addclass(this.wrapper,"iscrollbothscrollbars"),d.removeclass(this.wrapper,"iscrolllonescrollbar"),this.options.defaultscrollbars&&this.options.customstyle&&(this.options.listenx?this.wrapper.style.right="8px":this.wrapper.style.bottom="8px")):(d.removeclass(this.wrapper,"iscrollbothscrollbars"),d.addclass(this.wrapper,"iscrolllonescrollbar"),this.options.defaultscrollbars&&this.options.customstyle&&(this.options.listenx?this.wrapper.style.right="2px":this.wrapper.style.bottom="2px"));this.options.listenx&& (this.wrapperwidth=this.wrapper.clientwidth,this.options.resize?(this.indicatorwidth=f.max(f.round(this.wrapperwidth*this.wrapperwidth/(this.scroller.scrollerwidth||this.wrapperwidth||1)),8),this.indicatorstyle.width=this.indicatorwidth+"px"):this.indicatorwidth=this.indicator.clientwidth,this.maxposx=this.wrapperwidth-this.indicatorwidth,"clip"==this.options.shrink?(this.minboundaryx=-this.indicatorwidth+8,this.maxboundaryx=this.wrapperwidth-8):(this.minboundaryx=0,this.maxboundaryx=this.maxposx), this.sizeratiox=this.options.speedratiox||this.scroller.maxscrollx&&this.maxposx/this.scroller.maxscrollx);this.options.listeny&&(this.wrapperheight=this.wrapper.clientheight,this.options.resize?(this.indicatorheight=f.max(f.round(this.wrapperheight*this.wrapperheight/(this.scroller.scrollerheight||this.wrapperheight||1)),8),this.indicatorstyle.height=this.indicatorheight+"px"):this.indicatorheight=this.indicator.clientheight,this.maxposy=this.wrapperheight-this.indicatorheight,"clip"==this.options.shrink? (this.minboundaryy=-this.indicatorheight+8,this.maxboundaryy=this.wrapperheight-8):(this.minboundaryy=0,this.maxboundaryy=this.maxposy),this.maxposy=this.wrapperheight-this.indicatorheight,this.sizeratioy=this.options.speedratioy||this.scroller.maxscrolly&&this.maxposy/this.scroller.maxscrolly);this.updateposition()},updateposition:function(){var a=this.options.listenx&&f.round(this.sizeratiox*this.scroller.x)||0,b=this.options.listeny&&f.round(this.sizeratioy*this.scroller.y)||0;this.options.ignoreboundaries|| (athis.maxboundaryx?"scale"==this.options.shrink?(this.width=f.max(this.indicatorwidth-(a-this.maxposx),8),this.indicatorstyle.width=this.width+"px",a=this.maxposx+this.indicatorwidth-this.width):a=this.maxboundaryx:"scale"==this.options.shrink&&this.width!=this.indicatorwidth&&(this.width=this.indicatorwidth,this.indicatorstyle.width=this.width+ "px"),bthis.maxboundaryy?"scale"==this.options.shrink?(this.height=f.max(this.indicatorheight-3*(b-this.maxposy),8),this.indicatorstyle.height=this.height+"px",b=this.maxposy+this.indicatorheight-this.height):b=this.maxboundaryy:"scale"==this.options.shrink&&this.height!=this.indicatorheight&&(this.height=this.indicatorheight,this.indicatorstyle.height= this.height+"px"));this.x=a;this.y=b;this.scroller.options.usetransform?this.indicatorstyle[d.style.transform]="translate("+a+"px,"+b+"px)"+this.scroller.translatez:(this.indicatorstyle.left=a+"px",this.indicatorstyle.top=b+"px")},_pos:function(a,b){0>a?a=0:a>this.maxposx&&(a=this.maxposx);0>b?b=0:b>this.maxposy&&(b=this.maxposy);a=this.options.listenx?f.round(a/this.sizeratiox):this.scroller.x;b=this.options.listeny?f.round(b/this.sizeratioy):this.scroller.y;this.scroller.scrollto(a,b)},fade:function(a, b){if(!b||this.visible){cleartimeout(this.fadetimeout);this.fadetimeout=null;var c=a?0:300;this.wrapperstyle[d.style.transitionduration]=(a?250:500)+"ms";this.fadetimeout=settimeout(function(a){this.wrapperstyle.opacity=a;this.visible=+a}.bind(this,a?"1":"0"),c)}}};p.utils=d;"undefined"!=typeof module&&module.exports?module.exports=p:"function"==typeof define&&define.amd?define(function(){return p}):g.iscroll=p})(window,document,math);