jQuery resizing() 对象不缩回
我不明白为什么这不起作用。我有一个 div,里面有一个 iframe。我将 jQuery resizing() 应用于 div 并为我的 iframe 设置了“alsoResize”选项。这是它的实现方式:
$("#my-frame-wrapper").resizable({
alsoResize : '#myframe'
});
基本上,我试图直接在 iframe 中实现 resizing() ,但它不起作用,所以我尝试了这个方法。
问题是:
如果我拉伸 div,它会起作用(调整大小),但它不想缩回(如果我向后拖动)。相反,它完全失去了控制(在 Chrome 中),并且每次鼠标移动时它都会开始上下弹跳(我必须补充一点,非常烦人)。
我有什么遗漏的吗?还有其他人遇到过这个问题吗?
I don't understand why this doesn't work. I have a div with an iframe inside. I applied jQuery resizable() to the div and set the "alsoResize" option to my iframe. This is how it's implemented:
$("#my-frame-wrapper").resizable({
alsoResize : '#myframe'
});
Basically, I was trying to implement resizable() directly to the iframe, but it wouldn't work, so I tried this method.
The problem is:
If I stretch the div, it works (resizes), but it doesn't want to retract (if I drag back). Instead, it just goes completely out of control (in Chrome) and it starts bouncing up and down on every mouse-move (very annoying I must add).
Is there anything I am missing? Has anyone else experienced this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
iframe 元素内的鼠标事件不会消失,因此当您向后拖动时,JQuery UI 不会做出反应。
为了防止 iframe 捕获鼠标事件,可以在开始拖动时添加遮罩 div。
html:
css:
js:
请参阅 jsfiddle。
Mouse event inside the iframe element won't get out, so JQuery UI didn't react when you drag back.
In order to prevent iframe from capturing mouse event, you can add a mask div when drag is start.
html:
css:
js:
See jsfiddle.