IE7调整大小问题
我有一个页面,其中包含需要根据当前页面大小动态更改的内容。为了做到这一点,在 onload 事件期间,我将一些 JS 函数附加到“onresize”窗口事件。它看起来像这样:
window.onresize = function() {
//do something here...
};
这在任何浏览器中都可以正常工作,除了 IE7!
这些是我遇到的问题:
似乎在 IE7 中,当我仅垂直调整窗口大小(即用鼠标单击底部边框,然后将其向下拖动)时,它不会 触发“onresize”事件。
有时,我会得到“onresize”事件的无限循环,导致浏览器永远挂起。
对于这些问题的任何帮助,我将不胜感激。
谢谢, Moe
2天了,没有回复...不知道吗?我想我会在这里找到一些帮助......
i have a page that contains content which need to be dynamically changed according to the current page size. in order to do that, during the onload event, i attach some JS function to the "onresize" window event. it looks like that:
window.onresize = function() {
//do something here...
};
This is working fine in any browse, except IE7!
These are the problems i'm having:
It seems that in IE7, when i resize the window vertically only (i.e. clicking with the mouse on the bottom border, and drag it down), it does not fire the "onresize" event.
sometimes, i get an infinite loop of "onresize" event, causing the browser to hang forever.
I will appreciate any help with any of these issues.
thanks,
Moe
2 days and no answer... no idea? i thought i'll find some help here...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,这似乎是 Internet Explorer(版本 6 和 7)中的一个错误。该问题之前已在此论坛中提出过,最接近答案的是此处。在其他论坛上有关于此主题的讨论 http:// /us. Generation-nt.com/window-onresize-bug-feature-help-117486581.html 和 http://remysharp.com/2008/05/15/windowonresize-hangs-ie6-and-ie7/。看来您必须使用特定于浏览器的解决方法/重定向,因为它在其他浏览器中工作正常。
Yes, this seems to be a bug in Internet Explorer (both version 6 and 7). The problem has been raised before in this forum, the thing closest to an answer is here. On other forums there are discussions on this topic http://us.generation-nt.com/window-onresize-bug-feature-help-117486581.html and http://remysharp.com/2008/05/15/windowonresize-hangs-ie6-and-ie7/. It seems that you will have to use a browser-specific workaround/redirect since it works fine in other browsers.