Commit ce605c4f authored by hbcui1984's avatar hbcui1984

在拖拽期间,暂定图片轮播的定时任务;

parent e5048b05
...@@ -3856,6 +3856,7 @@ var mui = (function(document, undefined) { ...@@ -3856,6 +3856,7 @@ var mui = (function(document, undefined) {
slideNumber: self.slideNumber slideNumber: self.slideNumber
}); });
} }
self._initTimer();
}); });
self.wrapper.addEventListener('slide', function(e) { self.wrapper.addEventListener('slide', function(e) {
...@@ -3925,6 +3926,10 @@ var mui = (function(document, undefined) { ...@@ -3925,6 +3926,10 @@ var mui = (function(document, undefined) {
this._super(e); this._super(e);
var direction = e.detail.direction; var direction = e.detail.direction;
if (direction === 'left' || direction === 'right') { if (direction === 'left' || direction === 'right') {
//拖拽期间取消定时
var slidershowTimer = this.wrapper.getAttribute('data-slidershowTimer');
slidershowTimer && window.clearTimeout(slidershowTimer);
e.stopPropagation(); e.stopPropagation();
} }
}, },
...@@ -4055,7 +4060,6 @@ var mui = (function(document, undefined) { ...@@ -4055,7 +4060,6 @@ var mui = (function(document, undefined) {
if (time === 0) { if (time === 0) {
$.trigger(this.wrapper, 'scrollend', this); $.trigger(this.wrapper, 'scrollend', this);
} }
this._initTimer();
}, },
//API //API
setTranslate: function(x, y) { setTranslate: function(x, y) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -3856,6 +3856,7 @@ var mui = (function(document, undefined) { ...@@ -3856,6 +3856,7 @@ var mui = (function(document, undefined) {
slideNumber: self.slideNumber slideNumber: self.slideNumber
}); });
} }
self._initTimer();
}); });
self.wrapper.addEventListener('slide', function(e) { self.wrapper.addEventListener('slide', function(e) {
...@@ -3925,6 +3926,10 @@ var mui = (function(document, undefined) { ...@@ -3925,6 +3926,10 @@ var mui = (function(document, undefined) {
this._super(e); this._super(e);
var direction = e.detail.direction; var direction = e.detail.direction;
if (direction === 'left' || direction === 'right') { if (direction === 'left' || direction === 'right') {
//拖拽期间取消定时
var slidershowTimer = this.wrapper.getAttribute('data-slidershowTimer');
slidershowTimer && window.clearTimeout(slidershowTimer);
e.stopPropagation(); e.stopPropagation();
} }
}, },
...@@ -4055,7 +4060,6 @@ var mui = (function(document, undefined) { ...@@ -4055,7 +4060,6 @@ var mui = (function(document, undefined) {
if (time === 0) { if (time === 0) {
$.trigger(this.wrapper, 'scrollend', this); $.trigger(this.wrapper, 'scrollend', this);
} }
this._initTimer();
}, },
//API //API
setTranslate: function(x, y) { setTranslate: function(x, y) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -81,6 +81,7 @@ ...@@ -81,6 +81,7 @@
slideNumber: self.slideNumber slideNumber: self.slideNumber
}); });
} }
self._initTimer();
}); });
self.wrapper.addEventListener('slide', function(e) { self.wrapper.addEventListener('slide', function(e) {
...@@ -150,6 +151,10 @@ ...@@ -150,6 +151,10 @@
this._super(e); this._super(e);
var direction = e.detail.direction; var direction = e.detail.direction;
if (direction === 'left' || direction === 'right') { if (direction === 'left' || direction === 'right') {
//拖拽期间取消定时
var slidershowTimer = this.wrapper.getAttribute('data-slidershowTimer');
slidershowTimer && window.clearTimeout(slidershowTimer);
e.stopPropagation(); e.stopPropagation();
} }
}, },
...@@ -280,7 +285,6 @@ ...@@ -280,7 +285,6 @@
if (time === 0) { if (time === 0) {
$.trigger(this.wrapper, 'scrollend', this); $.trigger(this.wrapper, 'scrollend', this);
} }
this._initTimer();
}, },
//API //API
setTranslate: function(x, y) { setTranslate: function(x, y) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment