Closed drinkwater99 closed 6 years ago
@drinkwater99 you need to handle that in the click event handler there you need to track mouse up event if its still down then your dragging simply then track if mouse moves while down and then finaly if all that not happens fire your alert on mouse up
In case anyone else falls on to this, here is the solution
$(".element") .draggable() .click(function(){ if ( $(this).is('.ui-draggable-dragging') ) { return; } // click action here });
@drinkwater99
$(".element")
.draggable()
.click(function(){
if ( $(this).is('.ui-draggable-dragging') ) {
return;
}
// click action here
});
I am using dragging with jQuery UI Draggable.
How can I distinguish between a click or a drag ? That is, when I click on a grid item I want to show an alert() box but not when dragging a grid item. Is there some way to do this ?