Hi,
I have a site that is basicly "fixed" as in that the content will not move if you resize the window. I made the total width 800, so that most 800*600 browsers can read it without having to scroll(that much, I mean scrollbars won't take up that much room) Ok, every thing works. I recently got my document valid Strict, and decided to add a browser-stactic menu, that floats(NOTE: this is NOT the same script as on DD) in a div or table, displaying the W3's Valid document icon. This adds more width to the document. I decided that if the browser size (not resoultion) was more than (about) 830 px, then I would add the extra table around the outside so that the menu could float. if it was less than 830, It would display static below the copyright. Here is the nummed-down version of the script:
NOTE: I made the document so it was easy to tell which was inputed by what.HTML Code:<html> <body> <script language="JavaScript"><!-- function window_r() { w = 640; h = 480; NS4Plus = (document.layers) ? 1 : 0; IE4Plus = (document.all) ? 1 : 0; if (NS4Plus) { w = window.innerWidth; h = window.innerHeight; } if (IE4Plus) { /* The script must be inside the body tags - there is no body in the head of the document */ w = document.body.clientWidth; h = document.body.clientHeight; } } //--></script> <script language="JavaScript"><!-- window_r(); if(w>830) { document.write('<table bgcolor=red><tr><td>This was imported by javascript, and is in a red table'); } </script> <table bgcolor=green><tr><td> This Text Is Green, and is not affected when a red table surounds it. </td></tr></table> <script language="JavaScript"><!-- window_r(); if(w>830) { document.write('</td></tr></table>This was imported by javascript, but is not in a table.<br>'); } </script> This Text should not be affected whatever the size of the window. </body> </html>
When I added the above script into my document, only half the page showed up the top part dissappeared. I think beacause that is was not calling the function window_r(); in the seaperate <script> tags. I have no Idea what is going on, it works flaulessly on my local machine. HELP!



) Ok, every thing works. I recently got my document valid Strict, and decided to add a browser-stactic menu, that floats(NOTE: this is NOT the same script as on DD) in a div or table, displaying the W3's Valid document icon. This adds more width to the document. I decided that if the browser size (not resoultion) was more than (about) 830 px, then I would add the extra table around the outside so that the menu could float. if it was less than 830, It would display static below the copyright. Here is the nummed-down version of the script:
Reply With Quote


Bookmarks