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");}          } 

jsfiddle demo


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -