Skip to content

Commit

Permalink
v.1.3.0 contd, remove extra dragging
Browse files Browse the repository at this point in the history
  • Loading branch information
foo123 committed Apr 29, 2023
1 parent 39caa69 commit 17108ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/touchTouch.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,19 +231,19 @@ function touchTouch(items, options)
e.preventDefault && e.preventDefault();
var diff = (isTouch ? e.touches[0].pageX : e.pageX) - startX;

slider.style.marginLeft = String(diff) + 'px';
if (diff > 60)
//slider.style.marginLeft = String(diff) + 'px';
if (diff > 20)
{
if (sliderTouchMove) removeEvent(slider, sliderTouchMove.event, sliderTouchMove, {passive:false, capture:false});
sliderTouchMove = null;
slider.style.removeProperty('margin-left');
//slider.style.removeProperty('margin-left');
self.showPrevious();
}
else if (diff < -60)
else if (diff < -20)
{
if (sliderTouchMove) removeEvent(slider, sliderTouchMove.event, sliderTouchMove, {passive:false, capture:false});
sliderTouchMove = null;
slider.style.removeProperty('margin-left');
//slider.style.removeProperty('margin-left');
self.showNext();
}
}, {passive:false, capture:false});
Expand Down
2 changes: 1 addition & 1 deletion src/touchTouch.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 17108ac

Please sign in to comment.