jQuery可调整大小的句柄里面的孩子 [英] jQuery resizable handle inside child
问题描述
我收到此错误:
未捕获的TypeError:无法读取未定义的属性'ownerDocument'
Uncaught TypeError: Cannot read property 'ownerDocument' of undefined
当我尝试将可调整大小的句柄放在我想要调整大小的容器的子容器中时。
when I try to place my resizable handle inside a child of the container I am trying to resize.
如您所见,它目前是在控件 div中,但是句柄用于调整.ui-widget容器的大小,但是它会抛出上述错误。
As you can see, it is currently inside the controls div, however the handle is meant to resize the .ui-widget container, however it is instead throwing the above error.
但是,如果我将句柄移到控件 div之外,它可以正常工作。
If I move the handle outside of the controls div however, it works fine.
为什么会发生这种情况?有解决方法吗?
Why is this happening? Is there a workaround?
当前的jQuery代码:
Current jQuery code:
$("div.ui-widget").resizable({
handles: {
'se': 'div.ui-resizable-se'
},
start: function(e, ui) {
$(ui.helper).addClass("dragging");
},
stop: function(e, ui) {
$(ui.helper).removeClass("dragging");
oldWidget.saveState($(ui.helper), 'resize');
}
});
推荐答案
自己找到解决方案。
似乎它是导致它的JqueryUI版本!我正在使用1.11.x并且在恢复到1.10.4之后问题消失了并且它正常运行!
It seems that it was the JqueryUI version causing it! I was using 1.11.x and after reverting to 1.10.4 the problem is gone and it functions correctly!
任何理由都非常感谢。
这篇关于jQuery可调整大小的句柄里面的孩子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!