cancelRequestAnimationFrame||e.webkitCancelAnimationFrame||e.webkitCancelRequestAnimationFrame||e.mozCancelRequestAnimationFrame||e.oCancelRequestAnimationFrame||e.msCancelRequestAnimationFrame||clearTimeout}(),_=v?" translateZ(0)":"",D=function(n,r){var i=this,s;i.wrapper=typeof n=="object"?n:t.getElementById(n),i.scroller=i.wrapper.children[0],i.options={isOverflowHidden:!0,hScroll:!0,vScroll:!0,x:0,y:0,bounce:!0,bounceLock:!1,momentum:!0,lockDirection:!0,useTransform:!0,useTransition:!1,topOffset:0,checkDOMChanges:!1,handleClick:!0,hScrollbar:!0,vScrollbar:!0,fixedScrollbar:p,hideScrollbar:d,fadeScrollbar:d&&v,scrollbarClass:"",zoom:!1,zoomMin:1,zoomMax:4,doubleTapZoom:2,wheelAction:"scroll",snap:!1,snapThreshold:1,onRefresh:null,onBeforeScrollStart:function(e){e.preventDefault()},onScrollStart:null,onBeforeScrollMove:null,onScrollMove:null,onBeforeScrollEnd:null,onScrollEnd:null,onTouchEnd:null,onDestroy:null,onZoomStart:null,onZoom:null,onZoomEnd:null};for(s in r)i.options[s]=r[s];i.options.isOverflowHidden&&(i.wrapper.style.overflow="hidden"),i.x=i.options.x,i.y=i.options.y,i.options.useTransform=y&&i.options.useTransform,i.options.hScrollbar=i.options.hScroll&&i.options.hScrollbar,i.options.vScrollbar=i.options.vScroll&&i.options.vScrollbar,i.options.zoom=i.options.useTransform&&i.options.zoom,i.options.useTransition=b&&i.options.useTransition,i.options.zoom&&p&&(_=""),i.scroller.style[a]=i.options.useTransform?o+"transform":"top left",i.scroller.style[f]="0",i.scroller.style[l]="0 0",i.options.useTransition&&(i.scroller.style[c]="cubic-bezier(0.33,0.66,0.66,1)"),i.options.useTransform?i.scroller.style[u]="translate("+i.x+"px,"+i.y+"px)"+_:i.scroller.style.cssText+=";position:absolute;top:"+i.y+"px;left:"+i.x+"px",i.options.useTransition&&(i.options.fixedScrollbar=!0),i.refresh(),i._bind(T,e),i._bind(N),g||i.options.wheelAction!=="none"&&(i._bind("DOMMouseScroll"),i._bind("mousewheel")),i.options.checkDOMChanges&&(i.checkDOMTime=setInterval(function(){i._checkDOMChanges()},500))};D.prototype={enabled:!0,x:0,y:0,steps:[],scale:1,currPageX:0,currPageY:0,pagesX:[],pagesY:[],aniTime:null,wheelZoomCount:0,handleEvent:function(e){var t=this;switch(e.type){case N:if(!g&&e.button!==0)return;t._start(e);break;case C:t._move(e);break;case k:case L:t._end(e);break;case T:t._resize();break;case"DOMMouseScroll":case"mousewheel":t._wheel(e);break;case A:t._transitionEnd(e)}},_checkDOMChanges:function(){if(this.moved||this.zoomed||this.animating||this.scrollerW===this.scroller.offsetWidth*this.scale&&this.scrollerH===this.scroller.offsetHeight*this.scale)return;this.refresh()},_scrollbar:function(e){var n=this,i;if(!n[e+"Scrollbar"]){n[e+"ScrollbarWrapper"]&&(y&&(n[e+"ScrollbarIndicator"].style[u]=""),n[e+"ScrollbarWrapper"].parentNode.removeChild(n[e+"ScrollbarWrapper"]),n[e+"ScrollbarWrapper"]=null,n[e+"ScrollbarIndicator"]=null);return}n[e+"ScrollbarWrapper"]||(i=t.createElement("div"),n.options.scrollbarClass?i.className=n.options.scrollbarClass+e.toUpperCase():i.style.cssText="position:absolute;z-index:100;"+(e==="h"?"height:7px;bottom:1px;left:2px;right:"+(n.vScrollbar?"7":"2")+"px":"width:7px;bottom:"+(n.hScrollbar?"7":"2")+"px;top:2px;right:1px"),i.style.cssText+=";pointer-events:none;"+o+"transition-property:opacity;"+o+"transition-duration:"+(n.options.fadeScrollbar?"350ms":"0")+";overflow:hidden;opacity:"+(n.options.hideScrollbar?"0":"1"),n.wrapper.appendChild(i),n[e+"ScrollbarWrapper"]=i,i=t.createElement("div"),n.options.scrollbarClass||(i.style.cssText="position:absolute;z-index:100;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);"+o+"background-clip:padding-box;"+o+"box-sizing:border-box;"+(e==="h"?"height:100%":"width:100%")+";"+o+"border-radius:3px;border-radius:3px"),i.style.cssText+=";pointer-events:none;"+o+"transition-property:"+o+"transform;"+o+"transition-timing-function:cubic-bezier(0.33,0.66,0.66,1);"+o+"transition-duration:0;"+o+"transform: translate(0,0)"+_,n.options.useTransition&&(i.style.cssText+=";"+o+"transition-timing-function:cubic-bezier(0.33,0.66,0.66,1)"),n[e+"ScrollbarWrapper"].appendChild(i),n[e+"ScrollbarIndicator"]=i),e==="h"?(n.hScrollbarSize=n.hScrollbarWrapper.clientWidth,n.hScrollbarIndicatorSize=r.max(r.round(n.hScrollbarSize*n.hScrollbarSize/n.scrollerW),8),n.hScrollbarIndicator.style.width=n.hScrollbarIndicatorSize+"px",n.hScrollbarMaxScroll=n.hScrollbarSize-n.hScrollbarIndicatorSize,n.hScrollbarProp=n.hScrollbarMaxScroll/n.maxScrollX):(n.vScrollbarSize=n.vScrollbarWrapper.clientHeight,n.vScrollbarIndicatorSize=r.max(r.round(n.vScrollbarSize*n.vScrollbarSize/n.scrollerH),8),n.vScrollbarIndicator.style.height=n.vScrollbarIndicatorSize+"px",n.vScrollbarMaxScroll=n.vScrollbarSize-n.vScrollbarIndicatorSize,n.vScrollbarProp=n.vScrollbarMaxScroll/n.maxScrollY),n._scrollbarPos(e,!0)},_resize:function(){var e=this;e.resizeTimer=setTimeout(function(){e.refresh()},p?400:250)},_pos:function(e,t){if(this.zoomed)return;e=this.hScroll?e:0,t=this.vScroll?t:0,this.options.useTransform?this.scroller.style[u]="translate("+e+"px,"+t+"px) scale("+this.scale+")"+_:(e=r.round(e),t=r.round(t),this.scroller.style.left=e+"px",this.scroller.style.top=t+"px"),this.x=e,this.y=t,this._scrollbarPos("h"),this._scrollbarPos("v")},_scrollbarPos:function(e,t){var n=this,i=e==="h"?n.x:n.y,s;if(!n[e+"Scrollbar"])return;i=n[e+"ScrollbarProp"]*i,i<0?(n.options.fixedScrollbar||(s=n[e+"ScrollbarIndicatorSize"]+r.round(i*3),s<8&&(s=8),n[e+"ScrollbarIndicator"].style[e==="h"?"width":"height"]=s+"px"),i=0):i>n[e+"ScrollbarMaxScroll"]&&(n.options.fixedScrollbar?i=n[e+"ScrollbarMaxScroll"]:(s=n[e+"ScrollbarIndicatorSize"]-r.round((i-n[e+"ScrollbarMaxScroll"])*3),s<8&&(s=8),n[e+"ScrollbarIndicator"].style[e==="h"?"width":"height"]=s+"px",i=n[e+"ScrollbarMaxScroll"]+(n[e+"ScrollbarIndicatorSize"]-s))),n[e+"ScrollbarWrapper"].style[h]="0",n[e+"ScrollbarWrapper"].style.opacity=t&&n.options.hideScrollbar?"0":"1",n[e+"ScrollbarIndicator"].style[u]="translate("+(e==="h"?i+"px,0)":"0,"+i+"px)")+_},_start:function(t){var n=this,i=g?t.touches[0]:t,s,o,a,f,l;if(!n.enabled)return;n.options.onBeforeScrollStart&&n.options.onBeforeScrollStart.
Back to home |
File page
Subscribe |
Register |
Login
| N