Commit 8928bc0f authored by hbcui1984's avatar hbcui1984

Fix:Android4.4.4上图片轮播受软键盘影响导致自动轮播停止

parent 35f839be
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
var action = $.targets.action; var action = $.targets.action;
if (action && action.classList.contains($.className('action-back'))) { if (action && action.classList.contains($.className('action-back'))) {
$.back(); $.back();
$.targets.action = false;
} }
}); });
window.addEventListener('swiperight', function(e) { window.addEventListener('swiperight', function(e) {
......
...@@ -258,6 +258,7 @@ ...@@ -258,6 +258,7 @@
this._end(e); this._end(e);
break; break;
case 'webkitTransitionEnd': case 'webkitTransitionEnd':
this.transitionTimer && this.transitionTimer.cancel();
this._transitionEnd(e); this._transitionEnd(e);
break; break;
case 'scrollend': case 'scrollend':
...@@ -506,6 +507,12 @@ ...@@ -506,6 +507,12 @@
this.indicators[i].transitionTime(time); this.indicators[i].transitionTime(time);
} }
} }
if (time) { //自定义timer,保证webkitTransitionEnd始终触发
this.transitionTimer && this.transitionTimer.cancel();
this.transitionTimer = $.later(function() {
$.trigger(this.scroller, 'webkitTransitionEnd');
}, time + 100, this);
}
}, },
_transitionTimingFunction: function(easing) { _transitionTimingFunction: function(easing) {
this.scrollerStyle['webkitTransitionTimingFunction'] = easing; this.scrollerStyle['webkitTransitionTimingFunction'] = easing;
...@@ -702,7 +709,9 @@ ...@@ -702,7 +709,9 @@
}, },
scrollTo: function(x, y, time, easing) { scrollTo: function(x, y, time, easing) {
var easing = easing || ease.circular; var easing = easing || ease.circular;
this.isInTransition = time > 0 && (this.lastX != x || this.lastY != y); // this.isInTransition = time > 0 && (this.lastX != x || this.lastY != y);
//暂不严格判断x,y,否则会导致部分版本上不正常触发轮播
this.isInTransition = time > 0;
if (this.isInTransition) { if (this.isInTransition) {
this._clearRequestAnimationFrame(); this._clearRequestAnimationFrame();
this._transitionTimingFunction(easing.style); this._transitionTimingFunction(easing.style);
......
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