window.onresize 在 iPad 上连续调用

发布于 2024-12-19 01:53:38 字数 343 浏览 3 评论 0原文

我的页面上有一个 JS 代码,

window.onresize=someFunc;

现在我的 HTML 代码如下(我知道框架集很旧,应该避免,但这是我拥有的遗留代码);

<frameset>
  <frame src="abc.htm">
  <frame src="xyz.htm" noresize>
</frameset>

由于某些原因,window.onresize 在 iPad 上连续触发,并且调用方法 someFunc()。

我不确定可能是什么原因。请建议。

I have a JS code on my page as

window.onresize=someFunc;

Now my HTML code is as below (I know frameset are OLD and should be avoided but this is something legacy code which I have);

<frameset>
  <frame src="abc.htm">
  <frame src="xyz.htm" noresize>
</frameset>

For some reasons, the window.onresize gets fired continuosly on the iPad and the method someFunc() is called.

I am not sure what might be the reason. Please suggest.

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

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

发布评论

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

评论(1

情归归情 2024-12-26 01:53:38

我建议查看 someFunc 以确保它不会执行某些操作来触发另一次调整大小。我遇到了类似的情况(带有框架集的遗留代码),其中调整大小处理程序正在以触发另一个调整大小事件的方式更改页面大小,从而导致无限循环,页面变得越来越长。

I suggest looking at someFunc to make sure it's not doing something to trigger another resize. I ran into something similar (legacy code with framesets) where a resize handler was changing the page size in such a way as to trigger another resize event, leading to an infinite loop where the page just got longer and longer.

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