Safari 中 iFrame 调整大小

发布于 2024-08-18 05:40:01 字数 283 浏览 1 评论 0原文

当 iFrame 被其父级调整大小时,onresize 函数似乎不会在 Safari(3.03 beta windows 版本)中运行。这是一个已知的错误吗?除了基于计时器的检查之外,还有什么方法可以解决它吗?

iframe 及其父级位于同一域中,因此从父级调用调整大小函数是可行的,除了调用子框架函数的明显方法 - iframeObj.function(),其中 iframeObj 是对框架的对象引用,似乎只适用于 IE 和 Opera; FF、Safari、Chrome均无法运行该功能。

预先感谢您的任何帮助。

The onresize function doesn't seem to run in Safari (3.03 beta windows edition) when an iFrame is resized by its parent. Is this a known bug, and is there any way to get around it besides a timer-based check?

The iframe and its parent are in the same domain, so calling the resize function from the parent would be doable except that the apparent means of calling a child frame's function - iframeObj.function(), where iframeObj is an object reference to the frame, only seems to work in IE and Opera; FF, Safari and Chrome all fail to run the function.

Thanks in advance for any help.

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

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

发布评论

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

评论(1

一紙繁鸢 2024-08-25 05:40:01

虽然我仍然无法运行 onResize 函数,但我已经使用第二种方法解决了它 - 正确的函数调用是 iframeObj.contentWindow.function(),以供参考。

尽管它不再那么重要,但有关主要问题的任何信息仍将不胜感激。

Though I still can't get the onResize function to run, I've worked around it using the second method - the correct function call is iframeObj.contentWindow.function(), for reference.

Though it's no longer so important, any info on the primary question would yet be appreciated.

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