mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
Merge pull request #2114 from knoxHuang/fix_bug
fix pageview scrollToPage code
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user