I’m trying to call a function to check to position of a div after dragging it, but I am not sure how to make this work. I’ve written it out like this and a few other ways, but it either causes the whole thing not to work or the function isn’t called:
$(".block").draggable(),function() { check(); };
Is there a simple way to make this work?
There is the event named
stop. You can read about it here: http://jqueryui.com/demos/draggable/#event-stop.The example code for getting position of the dragged element after stop dragging can be this:
Check the working solution here: http://jsfiddle.net/rcmyy/