像这样的东西:
$("#0").draggable({
handle:'#borderItem #statementType #statementContent',
cursor: "move",
axis: "x",
stop: function(event, ui) {
var direction = (ui.originalPosition.left > ui.position.left) ? 'left' : 'right';
var distance = 0;
if (direction == "left")
{
distance = ui.originalPosition.left - ui.position.left;
}
else
{
distance = ui.position.left - ui.originalPosition.left;
}
if (distance>75)
{
self.articleSlid(direction);
}
else
{
// Revert!
}
}
});