function() {
			var self = this;
			if (self.options.enabledH5) {
				self.options.fiexdDur *= 2;
				self.boxInner.classList.add($.className('scroll-wrapper'));
				self.list.classList.add($.className('scroll'));
				self._scrollerApi = $(self.boxInner).scroll({
					deceleration: 0.002
				});
				//增加惯性滚动时的 scroll 触发处理
				//shimTetTranslate(self._scrollerApi);
				//--
				self.setScrollTop = function(y, dur, callback) {
					self._scrollerApi.scrollTo(0, -y, dur);
				};
				self.getScrollTop = function() {
					var self = this;
					if (self._scrollerApi.lastY > 0) {
						return 0
					} else {
						return Math.abs(self._scrollerApi.lastY);
					}
				};
			} else {
				//alert(0);
				//为 boxInner 增加 scrollend 事件 (没有原生 scrollend 事件)
				self.boxInner.addEventListener('scroll', function(event) {
					if (self.disabledScroll) return;
					self.isScrolling = true;
					if (self.scrollTimer) {
						clearTimeout(self.scrollTimer);
					}
					self.scrollTimer = setTimeout(function() {
						self.isScrolling = false;
						if (!self.isTouchDown || !$.os.ios) {
							$.trigger(self.boxInner, 'scrollend');
						}
					}, 150);
				}, false);
				self.aniScrollTop = function(y, dur, callback) {
					self.disabledScroll = true;
					var stepNum = dur > 0 ? dur / 10 : 1;
					var stepSize = (y - self.boxInner.scrollTop) / stepNum;
					self._lastScrollTop = self.boxInner.scrollTop; //记录最后的位置
					self._aniScrollTop(y, 0, stepNum, stepSize, callback);
				};
				self._aniScrollTop = function(y, stepIndex, stepNum, stepSize, callback) {
					self.boxInner.scrollTop = self._lastScrollTop + stepSize * stepIndex;
					if (stepIndex < stepNum) {
						setTimeout(function() {
							self._aniScrollTop(y, ++stepIndex, stepNum, stepSize);
						}, 10);
					} else {
						//self.boxInner.scrollTop = y;
						self.disabledScroll = false;
						if (callback) callback();
					}
				};
				self.setScrollTop = function(y, dur, callback) {
					self.aniScrollTop(y, dur);
				};
				self.getScrollTop = function() {
					var self = this;
					return self.boxInner.scrollTop;
				};
				//在 ios 上手指不弹起时，防止定位抖动开始
				if ($.os.ios) {
					self.boxInner.addEventListener('touchstart', function(event) {
						var self = this;
						self.isTouchDown = true;
					}, false);
					self.boxInner.addEventListener('touchend', function(event) {
						self.isTouchDown = false;
						if (!self.isScrolling) {
							setTimeout(function() {
								$.trigger(self.boxInner, 'scrollend');
							}, 0);
						}
					}, false);
				}
				//在 ios 上手指不弹起时，防止定位抖动结束
			}
		}
function() {
			var self = this;
			if (self.options.enabledH5) {
				self.options.fiexdDur *= 2;
				self.boxInner.classList.add($.className('scroll-wrapper'));
				self.list.classList.add($.className('scroll'));
				self._scrollerApi = $(self.boxInner).scroll({
					deceleration: 0.002
				});
				//增加惯性滚动时的 scroll 触发处理
				//shimTetTranslate(self._scrollerApi);
				//--
				self.setScrollTop = function(y, dur, callback) {
					self._scrollerApi.scrollTo(0, -y, dur);
				};
				self.getScrollTop = function() {
					var self = this;
					if (self._scrollerApi.lastY > 0) {
						return 0
					} else {
						return Math.abs(self._scrollerApi.lastY);
					}
				};
			} else {
				//alert(0);
				//为 boxInner 增加 scrollend 事件 (没有原生 scrollend 事件)
				self.boxInner.addEventListener('scroll', function(event) {
					if (self.disabledScroll) return;
					self.isScrolling = true;
					if (self.scrollTimer) {
						clearTimeout(self.scrollTimer);
					}
					self.scrollTimer = setTimeout(function() {
						self.isScrolling = false;
						if (!self.isTouchDown || !$.os.ios) {
							$.trigger(self.boxInner, 'scrollend');
						}
					}, 150);
				}, false);
				self.aniScrollTop = function(y, dur, callback) {
					self.disabledScroll = true;
					var stepNum = dur > 0 ? dur / 10 : 1;
					var stepSize = (y - self.boxInner.scrollTop) / stepNum;
					self._lastScrollTop = self.boxInner.scrollTop; //记录最后的位置
					self._aniScrollTop(y, 0, stepNum, stepSize, callback);
				};
				self._aniScrollTop = function(y, stepIndex, stepNum, stepSize, callback) {
					self.boxInner.scrollTop = self._lastScrollTop + stepSize * stepIndex;
					if (stepIndex < stepNum) {
						setTimeout(function() {
							self._aniScrollTop(y, ++stepIndex, stepNum, stepSize);
						}, 10);
					} else {
						//self.boxInner.scrollTop = y;
						self.disabledScroll = false;
						if (callback) callback();
					}
				};
				self.setScrollTop = function(y, dur, callback) {
					self.aniScrollTop(y, dur);
				};
				self.getScrollTop = function() {
					var self = this;
					return self.boxInner.scrollTop;
				};
				//在 ios 上手指不弹起时，防止定位抖动开始
				if ($.os.ios) {
					self.boxInner.addEventListener('touchstart', function(event) {
						var self = this;
						self.isTouchDown = true;
					}, false);
					self.boxInner.addEventListener('touchend', function(event) {
						self.isTouchDown = false;
						if (!self.isScrolling) {
							setTimeout(function() {
								$.trigger(self.boxInner, 'scrollend');
							}, 0);
						}
					}, false);
				}
				//在 ios 上手指不弹起时，防止定位抖动结束
			}
		}
function ( ) { var self = this ; if ( self . options . enabledH5 ) { self . options . fiexdDur *= 2 ; self . boxInner . classList . add ( $ . className ( 'scroll-wrapper' ) ) ; self . list . classList . add ( $ . className ( 'scroll' ) ) ; self . _scrollerApi = $ ( self . boxInner ) . scroll ( { deceleration : 0.002 } ) ; //增加惯性滚动时的 scroll 触发处理 //shimTetTranslate(self._scrollerApi); //-- self . setScrollTop = function ( y , dur , callback ) { self . _scrollerApi . scrollTo ( 0 , - y , dur ) ; } ; self . getScrollTop = function ( ) { var self = this ; if ( self . _scrollerApi . lastY > 0 ) { return 0 } else { return Math . abs ( self . _scrollerApi . lastY ) ; } } ; } else { //alert(0); //为 boxInner 增加 scrollend 事件 (没有原生 scrollend 事件) self . boxInner . addEventListener ( 'scroll' , function ( event ) { if ( self . disabledScroll ) return ; self . isScrolling = true ; if ( self . scrollTimer ) { clearTimeout ( self . scrollTimer ) ; } self . scrollTimer = setTimeout ( function ( ) { self . isScrolling = false ; if ( ! self . isTouchDown || ! $ . os . ios ) { $ . trigger ( self . boxInner , 'scrollend' ) ; } } , 150 ) ; } , false ) ; self . aniScrollTop = function ( y , dur , callback ) { self . disabledScroll = true ; var stepNum = dur > 0 ? dur / 10 : 1 ; var stepSize = ( y - self . boxInner . scrollTop ) / stepNum ; self . _lastScrollTop = self . boxInner . scrollTop ; //记录最后的位置 self . _aniScrollTop ( y , 0 , stepNum , stepSize , callback ) ; } ; self . _aniScrollTop = function ( y , stepIndex , stepNum , stepSize , callback ) { self . boxInner . scrollTop = self . _lastScrollTop + stepSize * stepIndex ; if ( stepIndex < stepNum ) { setTimeout ( function ( ) { self . _aniScrollTop ( y , ++ stepIndex , stepNum , stepSize ) ; } , 10 ) ; } else { //self.boxInner.scrollTop = y; self . disabledScroll = false ; if ( callback ) callback ( ) ; } } ; self . setScrollTop = function ( y , dur , callback ) { self . aniScrollTop ( y , dur ) ; } ; self . getScrollTop = function ( ) { var self = this ; return self . boxInner . scrollTop ; } ; //在 ios 上手指不弹起时，防止定位抖动开始 if ( $ . os . ios ) { self . boxInner . addEventListener ( 'touchstart' , function ( event ) { var self = this ; self . isTouchDown = true ; } , false ) ; self . boxInner . addEventListener ( 'touchend' , function ( event ) { self . isTouchDown = false ; if ( ! self . isScrolling ) { setTimeout ( function ( ) { $ . trigger ( self . boxInner , 'scrollend' ) ; } , 0 ) ; } } , false ) ; } //在 ios 上手指不弹起时，防止定位抖动结束 } }
根据 options 处理不同平台兼容问题
根据 options 处理不同平台兼容问题
scroll to top of the list