briangonzalez / jquery.pep.js

👟 Pep, a lightweight plugin for kinetic drag on mobile/desktop
http://pep.briangonzalez.org
1.3k stars 178 forks source link

Do not start the drag until... #173

Closed alexmngn closed 8 years ago

alexmngn commented 8 years ago

I was wondering if there is a way to start to drag the element only until a couple of pixels are reached? For example, when I click down and move the mouse 5 pixels to the right, it will start to drag the element and not before it reaches those 5 pixels. Thanks

Joeao commented 8 years ago

You could set the grid as [5,5], then on the drag event see if the start position is beyond 5 pixels from the starting point, if so set the grid to [0,0]. I've not tested this myself, it's worth trying though.