我试图在iframe中加载一些html,并使html页面中的某些元素可排序:
小提琴
JS:
var _iframe = $('iframe');
var containment = _iframe.contents().find( "modules" );
if(containment.data('sortable')) containment.sortable('destroy');
containment.sortable({
stop: function (event, ui) {
console.log('STOP: I am never called');
},
start: function (event, ui) {
console.log('START: I am called with a delay!');
},
containment: containment,
placeholder: "sortable-placeholder",
items: "> module",
delay: 10,
forcePlaceholderSize: true,
helper: 'clone',
zIndex: 10000
});这会导致一些意想不到的行为,如延迟启动事件和无停止事件。
只有当内容在iframe中时,问题才会发生。没有iframe的这是一个版本 (以及它应该如何工作)
尝试对元素在这个版本中进行排序(并使您的控制台保持打开状态)
发布于 2013-10-16 07:56:09
似乎唯一可行的解决方案是将代码放在iframe中。也许父母打扫他房间的时候不喜欢.
https://stackoverflow.com/questions/19274439
复制相似问题