|
|
@ -83,9 +83,9 @@ |
|
|
|
if (e.touches.length > 1 || !slider) { |
|
|
|
if (e.touches.length > 1 || !slider) { |
|
|
|
return; // Exit if a pinch || no slider
|
|
|
|
return; // Exit if a pinch || no slider
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// adjust the starting position if we just started to avoid jumpage
|
|
|
|
// adjust the starting position if we just started to avoid jumpage
|
|
|
|
if(!startedMoving) { |
|
|
|
if (!startedMoving) { |
|
|
|
pageX += (e.touches[0].pageX - pageX) - 1; |
|
|
|
pageX += (e.touches[0].pageX - pageX) - 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -96,7 +96,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
if (typeof isScrolling === 'undefined' && startedMoving) { |
|
|
|
if (typeof isScrolling === 'undefined' && startedMoving) { |
|
|
|
isScrolling = Math.abs(deltaY) > Math.abs(deltaX); |
|
|
|
isScrolling = Math.abs(deltaY) > Math.abs(deltaX); |
|
|
|
}
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (isScrolling) { |
|
|
|
if (isScrolling) { |
|
|
|
return; |
|
|
|
return; |
|
|
@ -110,7 +110,7 @@ |
|
|
|
slideNumber === lastSlide && deltaX < 0 ? (Math.abs(pageX) / sliderWidth) + 1.25 : 1; |
|
|
|
slideNumber === lastSlide && deltaX < 0 ? (Math.abs(pageX) / sliderWidth) + 1.25 : 1; |
|
|
|
|
|
|
|
|
|
|
|
slider.style.webkitTransform = 'translate3d(' + offsetX + 'px,0,0)'; |
|
|
|
slider.style.webkitTransform = 'translate3d(' + offsetX + 'px,0,0)'; |
|
|
|
|
|
|
|
|
|
|
|
// started moving
|
|
|
|
// started moving
|
|
|
|
startedMoving = true; |
|
|
|
startedMoving = true; |
|
|
|
}; |
|
|
|
}; |
|
|
@ -119,7 +119,7 @@ |
|
|
|
if (!slider || isScrolling) { |
|
|
|
if (!slider || isScrolling) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// were done moving
|
|
|
|
// were done moving
|
|
|
|
startedMoving = false; |
|
|
|
startedMoving = false; |
|
|
|
|
|
|
|
|
|
|
|