IE7调整大小问题

发布于 2024-09-02 03:15:04 字数 490 浏览 1 评论 0原文

我有一个页面,其中包含需要根据当前页面大小动态更改的内容。为了做到这一点,在 onload 事件期间,我将一些 JS 函数附加到“onresize”窗口事件。它看起来像这样:

window.onresize = function() {
  //do something here...
};

这在任何浏览器中都可以正常工作,除了 IE7!

这些是我遇到的问题:

  1. 似乎在 IE7 中,当我仅垂直调整窗口大小(即用鼠标单击底部边框,然后将其向下拖动)时,它不会 触发“onresize”事件。

  2. 有时,我会得到“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:

  1. 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.

  2. 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 技术交流群。

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

发布评论

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

评论(1

指尖微凉心微凉 2024-09-09 03:15:04

是的,这似乎是 Internet Explorer(版本 6 和 7)中的一个错误。该问题之前已在此论坛中提出过,最接近答案的是此处。在其他论坛上有关于此主题的讨论 http:// /us. Generation-nt.com/window-onresize-bug-feature-help-117486581.htmlhttp://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.

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