> I realize this is probably something I'm overlooking but is there some > way to constrain a drag to a particular direction (horizontal/ > vertical)? I've been searching google, docs, and the like for an > answer to no avail.
Drag has a 'modifiers' option, set the property you don't want to move to null:
To make it drag in y-direction only:
new Drag(element, {
'modifiers': {'x': null, 'y': 'top'},
});
And for the x-direction:
new Drag(element, {
'modifiers': {'x': 'left', 'y': null},
});
--
Tim
