app修改
diff --git a/www/js/lib/aui-slide.js b/www/js/lib/aui-slide.js
index 2f44157..f2b79b3 100644
--- a/www/js/lib/aui-slide.js
+++ b/www/js/lib/aui-slide.js
@@ -8,7 +8,7 @@
*/
(function(window) {
"use strict";
-
+ var autoInderval;
var translateVal,
firstTouchX,
firstTouchY,
@@ -87,7 +87,7 @@
this.createPagination(0);
this.setPageDotPosition();
}
- if(this.options.autoPlay > 500 && this.loop){
+ if(this.options.autoPlay > 500){
this.autoPlay(0);
}
this.slideWrap.addEventListener('touchstart', this.touchStart.bind(this), false);
@@ -104,13 +104,18 @@
// 自动播放
auiSlide.prototype.autoPlay = function (index) {
var self = this;
- setInterval(function(){
+ autoInderval = setInterval(function(){
self.slideTo(self.getCircle(self.index-1), -self.slideWrapWidth, 0);
self.slideTo(self.getCircle(self.index+2), self.slideWrapWidth, 0);
self.slideTo(self.index, -self.slideWrapWidth, self.options.speed);
self.slideTo(self.getCircle(self.index+1), 0, self.options.speed);
self.index = self.getCircle(self.index+1);
self.setPaginationActive(self.index);
+ if((self.index+1)==self.pageCount()){
+ if(!self.options.loop){
+ clearInterval(autoInderval);
+ }
+ }
}, self.options.autoPlay)
};
// 设置当前分页