开发者

Draggable Jquery

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜