JQuery 可排序和消失的子元素 [IE]

发布于 2024-10-07 17:41:15 字数 969 浏览 0 评论 0原文

代码可以在这里找到:http://www.myhorizo​​n.ca/client_central/sortable_test.php

Stackoverflow 的朋友们大家好,

我有一个可排序的类别列表。每个类别都有一个部分列表,这些部分也可以排序,但所述部分可以从一个类别拖动到另一个类别。我的代码在 Firefox 和 Chrome 中运行良好,但在 IE 中,当我拖放可排序项目时,子元素(如工具栏图标)变得混乱(因为缺乏更好的词)。有时这些元素会消失,有时它们会出现在最奇怪的地方。

我有一种感觉 IE 在重绘我的所有内容时遇到问题,但我不知道如何解决它。如有任何帮助,我们将不胜感激:)

    $('.category').sortable({
    'handle' : '.cat-drag-and-drop',
    connectWith: '.category',
    start: function()
    {
        $('.category *').disableSelection();
    },
    stop: function()
    {
        $('.category *').enableSelection();
    }
});

$('.section').sortable({
    'handle' : '.section-drag-and-drop',
    connectWith: '.section',
    start: function()
    {
        $('.section *').disableSelection();
    },
    stop: function()
    {
        $('.section *').enableSelection();
    }
});

Code can be found here: http://www.myhorizon.ca/client_central/sortable_test.php

Hello folks of Stackoverflow,

I have a list of categories that are sortable. Each category has a list of sections that are also sortable but said sections can be dragged from category to category. My code works fine in Firefox and Chrome but in IE when I drag and drop my sortable items the children elements (like the toolbar icons) get all jarbbled (for lack of a better word). Sometimes the elements just disappear and sometimes they are in the strangest places.

I have a feeling IE is having a problem redrawing all my stuff but I can't figure out how to fix it. Any help is appreciated :)

    $('.category').sortable({
    'handle' : '.cat-drag-and-drop',
    connectWith: '.category',
    start: function()
    {
        $('.category *').disableSelection();
    },
    stop: function()
    {
        $('.category *').enableSelection();
    }
});

$('.section').sortable({
    'handle' : '.section-drag-and-drop',
    connectWith: '.section',
    start: function()
    {
        $('.section *').disableSelection();
    },
    stop: function()
    {
        $('.section *').enableSelection();
    }
});

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

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

发布评论

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

评论(1

摇划花蜜的午后 2024-10-14 17:41:15

我在启用选择后通过链接 .focus().blur() 来“修复”它(我猜这会迫使 IE 将元素重新绘制到正确的位置)。我本想避免这样的修复,但有时你必须做你必须做的:)

I "fixed" it by chaining .focus().blur() after my enabling of the selection (which I guess forces IE to redraw the elements in their correct position). I would have liked to avoid such a fix but sometimes you have to do what you have to do :)

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