Hi there,
I've been using your drag and drop plugin for a while now and I'm
pleased to see you're supporting touch events in 2.1.0.
I've written a carousel that was once using jQuery UIs mouse widget to
implement the drag events however they don't currently support touch
and the special event API just makes more sense imo. Anyway I've hit a
problem where I need the drag event to only fire when its bias is in
the direction of a particular axis. Thanks to the delta properties you
provide this is easy enough by checking which of deltaX and deltaY is
greater:
if (Math.abs(data.deltaX) > Math.abs(data.deltaY)) {
// X axis
} else {
// Y axis
}
The issue here is the default action (scrolling) is prevented on
touchmove regardless of the axis so in the instance of my carousel the
page cannot be scrolled on the y axis even when the carousel is
horizontal. Obviously preventingDefault is fine in many cases but I
think the ability to set which axis you're interested in would be a
useful addition.
As you've obviously got an intimate understanding of the drag event I
wondered what your thoughts on this are and whether you think it's
easy enough to implement. Does it make sense to pass in an 'axis'
option into the eventData options and at the time of touchmove is is
possible to get the required data to determine deltas and consequently
the axis bias of the drag?
Any help would be much appreciated.
Cheers,
Richard
https://github.com/richardscarrott/jquery-ui-carousel