Skip to content

Commit 3a296f7

Browse files
committed
touchend might not have a touch
1 parent bbc2e0d commit 3a296f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/js/jquery.swipebox.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@
389389

390390

391391
if ( vSwipe ) {
392-
if ( slider.css( 'opacity' ) <= 0.5) {
392+
if ( slider.css( 'opacity' ) <= 0.5 && Math.abs(vDistance) > Math.abs(vDistanceLast)) {
393393
var vOffset = vDistance > 0 ? slider.height() : - slider.height();
394394
slider.animate( { top: vOffset + 'px', 'opacity': 0 },
395395
300,
@@ -403,10 +403,10 @@
403403
vSwipe = false;
404404
return;
405405
} else if ( hSwipe ) {
406-
if( hDistance >= hSwipMinDistance ) {
406+
if( hDistance >= hSwipMinDistance && hDistance >= hDistanceLast) {
407407
// swipeLeft
408408
$this.getPrev();
409-
} else if ( hDistance <= -hSwipMinDistance ) {
409+
} else if ( hDistance <= -hSwipMinDistance && hDistance <= hDistanceLast) {
410410
// swipeRight
411411
$this.getNext();
412412
}

0 commit comments

Comments
 (0)