views:

297

answers:

1

I'm using JQuery UI to drag divs around a container and i want to fire an event when the user releases the mouse (stops dragging).

Any ideas on how to do this would be great. Thanks in advance

-Shawn

+1  A: 

If you're using jQuery UI, you have a built in function already:

http://docs.jquery.com/UI/Draggable#event-stop

$('.selector').draggable({
     stop: function(event, ui) { ... }
});

If you're not using the Draggable function from the UI, I'd recommend you do so. It will make your life easier for this! It's already written!

Nathan Loding