Response title
This is preview!




// set a var as false as a way to change and flag if something is being dragged
var dragCheck = false;
$('.element').draggable({
revert: true,
drag: function(){
// On drag set that flag to true
dragCheck = true;
},
stop: function(){
// On stop of dragging reset the flag back to false
dragCheck = false;
}
});
// Then instead of using click use mouseup, and on mouseup only fire if the flag is set to false
$('.element')
.bind('mouseup', function(){
if(dragCheck == false){
// do the click action here...
}
});
© 2012 jQuery Foundation
Sponsored by
and others.
