如何使用 Mootools Sortables 为多个列表指定特定的 onComplete 事件?

发布于 2024-12-19 14:58:30 字数 401 浏览 2 评论 0原文

如何使用 Mootools Sortables 为多个列表指定特定的 onComplete 事件?

就像如果您将一个项目从 list1 拖到 list2 一样,它会将项目 NAME 标记更改为某个内容,如果将同一项目从 list2 拖回 list1,则 NAME 会变回之前的样子?

没有什么动态的,只是通用 ID。因此,如果某个项目位于 list1 中,则其名称为“input_id”,如果将其拖动到 list2,则应将其更改为“input_id2”,反之亦然。

http://jsfiddle.net/nicekiwi/yrzgt/

Mootools 1.4.1

谢谢。

How can I specify specific onComplete events for multipul lists with Mootools Sortables?

Like if you drag an item from list1 to list2 it will change the items NAME tag to something and if the same item is dragged from list2 back to list1 the NAME would change back to what it was before?

Nothing dynamic, just generic IDs. So if an item is in list1 its name is 'input_id' and if its dragged to list2 it should be changed to 'input_id2' and vice verse.

http://jsfiddle.net/nicekiwi/yrzgt/

Mootools 1.4.1

Thank you.

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

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

发布评论

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

评论(2

夏至、离别 2024-12-26 14:58:30

您需要使用 SortabledragOptions 选项来设置一些 Drag.Move 选项。我制作了一个更新您的小提琴的示例,请参阅此处

参考此处此处

You need to use Sortable's dragOptions option to setup some Drag.Move options. I made an example updating your fiddle, see here.

References here and here.

独木成林 2024-12-26 14:58:30
var mod_sorting = function()
{
    new Sortables('#list1 ,#list2',
    {
        onComplete: function(el)
        {
            $('#list1 li input').setProperty('name','input_id[]');
            $('#list2 li input').setProperty('name','');
        }
    });
}
var mod_sorting = function()
{
    new Sortables('#list1 ,#list2',
    {
        onComplete: function(el)
        {
            $('#list1 li input').setProperty('name','input_id[]');
            $('#list2 li input').setProperty('name','');
        }
    });
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文