| 1 |
- define(function(n,t,i){"use strict";var e=n("../util"),o=n("../base"),l=function(n){l.superclass.constructor.call(this,n),this.userConfig=e.mix({},n)};if(e.extend(l,o,{pluginId:"fastscroll",pluginInitializer:function(n){var t=this;t.xscroll=n,t._bindEvt()},pluginDestructor:function(){},_bindEvt:function(){var n=this,t=n.xscroll,i=t.mc,e=[],o=t.userConfig.maxSpeed||2,l=function(n){var t=n.length;if(0!=t){for(var i=0,e=0;e<t;e++)i+=n[e];return i/t}};i.on("panend",function(n){if(Math.abs(n.velocityY)>1.5&&(0==e.length||n.velocityY/e[e.length-1]>0)?e.push(n.velocityY*Math.pow(1.2,e.length)):(e=[],t.userConfig.maxSpeed=o),e.length>3){var i=l(e);t.userConfig.maxSpeed=Math.abs(i),t._onpanend({velocityY:i})}})}}),"object"==typeof i&&i.exports)i.exports=l;else if(window.XScroll&&window.XScroll.Plugins)return XScroll.Plugins.FastScroll=l});
|