Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onresize - makes IE 6 hang some times?

Status
Not open for further replies.

Olavxxx

Programmer
Sep 21, 2004
1,134
NO
Hi, I use this code:
Code:
<div class="colboxmiddle_BDA82ACF" id="contentDiv" onresize="document.getElementById('optimalgrid').innerHTML = ('&lt;br /&gt;&lt;div style=&quot;float:left;&quot;&gt;&lt;img src=&quot;images/size.gif&quot; /&gt;&lt;/div&gt; &lt;strong&gt;Vinduet har blitt skalert&lt;/strong&gt;, vennligst oppdater rutenettst&oslash;rrelse.');">

The thing is that I have made some nifty functions for changing the layout of a grid (rows and colums, css-based), in an image-gallery. The idea is that I want to notify the user that the browser has been resized and that he/she can now auto-size the grid, by clicking the nifty GUI I made for sizing the grid.

Everything works fine, but sometimes it all hangs when I have this onresize code inside the div.

ps. the div is a content-div, which scales between two colums.. Does anyone have any suggestions? There are no errors when it works, so I dont really understand what's going on here. Might just be the old IE, but we cant upgrade the browsers here at work, so if it's an browser issue, I guess I'll just have to not use this.

Olav Alexander Mjelde
Admin & Webmaster
 
The element may not be present when you trigger the resize. I would wrap the assignment to innerHTML in a test. Something like:
Code:
... onresize="if(document.getElementById('optimalgrid')){document.getElementById('optimalgrid').innerHTML='..';}" ...

Just a thought.

Cheers,
Jeff


[tt]Jeff's Page [!]@[/!] Code Couch
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Hi, thanks for the input.. But the element is present..
You see, the template doesent change even though the contents (dynamic) does. eg. static columns, but the center column changes in width.

The side-colum to the right, contains the span with the id="optimalgrid". I figure it might be an IE6 issue and now I just got an email that in the fall, they are swapping for XP here, so I guess that might also mean a newer IE than 6.0. I'll revisit this thread if I find out some more.

Olav Alexander Mjelde
Admin & Webmaster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top