Merge pull request #910 from zilongshanren/add-stop-autoscroll-api

add stopAutoScroll API for scrollview
This commit is contained in:
Wang Nan
2016-07-14 16:56:30 +08:00
committed by GitHub
+11 -2
View File
@@ -631,6 +631,16 @@ var ScrollView = cc.Class({
}
},
/**
* !#en Stop auto scroll immediately
* !#zh 停止自动滚动, 调用此 API 可以让 Scrollview 立即停止滚动
* @method stopAutoScroll
*/
stopAutoScroll: function() {
this._autoScrolling = false;
this._autoScrollAccumulatedTime = this._autoScrollTotalTime;
},
/**
* !#en Modify the content position.
* !#zh 设置当前视图内容的坐标点。
@@ -1295,8 +1305,7 @@ var ScrollView = cc.Class({
onDisable: function() {
this._hideScrollbar();
this._autoScrolling = false;
this._autoScrollAccumulatedTime = this._autoScrollTotalTime;
this.stopAutoScroll();
},
update: function(dt) {