Move draggable to position programmatically

南笙酒味 提交于 2019-12-05 06:30:43

DEMO

Using extra javascript sources you can achieve what you are looking for.

From jQuery UI:
jquery.simulate.js

From 3rd party:
Source: http://j-ulrich.github.io/jquery-simulate-ext/
jquery.simulate.ext.js
jquery.simulate.drag-n-drop.js

Props to j-ulrich for making it so easy.

function dragTo(x, y) {
    $("#draggable").simulate("drag-n-drop", {dx: x, dy: y, interpolation: { stepWidth: 1, stepDelay: 1}});
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!