JQuery 可排序,在两个列表之间拖动,取消放置:如何制作动画?

发布于 2024-09-24 09:17:41 字数 272 浏览 0 评论 0原文

我有两个 HTML 列表,并使用 JQuery sortable 在它们之间拖动。这非常有效。

将拖动的列表项拖放到第二个列表中时会引发 receive 事件。在此事件处理程序中,在某些情况下,我调用

$(ui.sender).sortable('cancel');

它取消放置并将列表项返回到其在第一个列表中的原始位置。

我的问题是,如何将列表项移动回其原始位置?此刻,该物品直接弹回。

谢谢!

I have two HTML lists, and am using JQuery sortable to drag between them. This works perfectly.

The receive event is raised upon dropping a dragged list item into the second list. In this event handler, in some circumstances I am calling

$(ui.sender).sortable('cancel');

which cancels the drop and returns the list item to its original position in the first list.

My question is, how can I animate the movement of the list item back to its original position? At the moment the item snaps straight back.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌逼全场 2024-10-01 09:17:41

我设法通过结合使用 jqueryUI 的 可拖动和可排序 来回避这个问题。

I managed to side-step this issue by using a combination of jqueryUI's draggable and sortable.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文