JQuery 可排序和消失的子元素 [IE]
代码可以在这里找到:http://www.myhorizon.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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在启用选择后通过链接 .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 :)