jquery draggable options

后端 未结 6 1544
梦谈多话
梦谈多话 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:17

    Revert option is set to false by default, you've to set it to true.

    $("#draggable").draggable({ 
        revert: true
    });
    

    this should do it actually...

提交回复
热议问题