开发者

Draggable Jquery

开发者 https://www.devze.com 2023-01-07 09:23 出处:网络
How can i change the id of div when drag is stop 开发者_Python百科using JQuery.You can use the stop event, like this:

How can i change the id of div when drag is stop 开发者_Python百科using JQuery.


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 :)


$("myDiv").attr('id', 'newid'); ??

0

精彩评论

暂无评论...
验证码 换一张
取 消