views:

108

answers:

1

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

+1  A: 

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.

user8472