Stereobit / dragend

dragend JS – a touch ready, full responsive, content swipe script
http://stereobit.github.com/dragend/
MIT License
485 stars 114 forks source link

One fix, One upgrade #78

Open joetex opened 8 years ago

joetex commented 8 years ago

There was a bug with large minDragDistance values, where it would not scroll back to page if the distanceX was < 0.

This was on line 428: } else if (parsedEvent.distanceX > 0 || parsedEvent.distanceX > 0) { I fixed to: } else if (parsedEvent.distanceX > 0 || parsedEvent.distanceX < 0) {

I also needed to know which direction the onSwipeStart was moving, so I added the direction as the 4th parameter to the onSwipeStart event. This would be beneficial to onSwipeEnd as well.

m1sta commented 8 years ago

You should file a pull request.

Roman-Mzh commented 8 years ago

your else if fires if distanceX is less than 0 and if greater than 0 :)

the correct one is:

Math.abs(parsedEvent.distanceX) > 0 || Math.abs(parsedEvent.distanceY) > 0`

it should fire for both X and Y abs values.