It sounnds like resizing when the page has not loaded causes the script to break. This isn't surprising as some of the elements the script needs to access may not yet have been created.
Use a flag in the head part of the html and the onload event of the body element to set the flag to true and prevent the resize() function from executing if the flag is set to false.
Code:<html> <head> <script type="text/javascript"> <!-- var loaded = false; function resize() { if (! loaded) return /* .... */ } //--> </script> </head> <body onload="loaded=true;"> ... .. </html>




Reply With Quote