javascript - distance jQuery UI draggable object has been moved, dragged -
i using following code allow members of .datacard
class draggable left or right, revert original positions.
$('.datacard').draggable({ axis: 'x', revert: true });
how can tell distance item away original position?
have made across 1 axis ..
drag: function (e, ui){ y2 = ui.position.top; x2 = ui.position.left; if(y2>100){alert("greater");} if(y2>100){alert("greater");} }
Comments
Post a Comment