jquery draggable options

后端 未结 6 1558
梦谈多话
梦谈多话 2021-01-11 15:48

i want the draggable object to revert back to its original position when i click a button. i used \'destroy\' option but it doesnt seem to work. it disables the dragging but

6条回答
  •  终归单人心
    2021-01-11 16:18

    EDIT: I'm pretty sure this will do the trick:

    //reposition the draggable after it has finished
    $(".selector").draggable({  
        stop: function(e,ui) { 
            ui.instance.element.css("left","0px"); 
            ui.instance.element.css("top","0px"); 
        } 
    });
    

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题