Reputation: 986
How can i change the id of div when drag is stop using JQuery.
Upvotes: 0
Views: 204
Reputation: 630597
You can use the stop
event, like this:
$("#draggable").draggable({
stop: function() {
this.id = "newID"; //calc whatever the new ID is, assign here
}
});
You can test it here, in the stop
callback, this
refers to the dragged element, so do with it what you want :)
Upvotes: 2