Merge pull request #2114 from knoxHuang/fix_bug

fix pageview scrollToPage code
This commit is contained in:
Jare Guo
2017-11-16 16:21:40 +08:00
committed by GitHub
+1 -1
View File
@@ -369,7 +369,7 @@ var PageView = cc.Class({
* @param {Number} timeInSecond scrolling time
*/
scrollToPage: function (idx, timeInSecond) {
if (idx < 0 || idx > this._pages.length)
if (idx < 0 || idx >= this._pages.length)
return;
timeInSecond = timeInSecond !== undefined ? timeInSecond : 0.3;
this._curPageIdx = idx;