window.onresize 在 iPad 上连续调用
我的页面上有一个 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议查看
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.