Hi, I've made a web page (I used css and XHTML Strict) using divs and I was wondering if I could use Javascript to make the content div be the width of the screen - 145 pixels (that way I get a nice 10 pixel indent on the right side), if the screen size is greater than 800 pixels (so I have a minumum width).I've been searching around for the last 2 hours and haven't come across anything/anything that works.I've never done anything with javascript (this may be why I'm running into difficulties, lol), but I've done some programming before so I can usually understand a lot of it.I asked before about something similar to this and someone suggested using JavaScript HTML DOM Objects... but like I said, I have not been able to get anything working.Sooo... is this possible(and to make it work between FF and IE)? And does anyone have any good examples/tutorials if it is?THANKS!EDIT: I think I've figured out the problem. Are there any errors in this? It excludes FF a little because I found FF a little wonky. Wooo my first script.
function Resize(){ var content = document.getElementById("content"); var header = document.getElementById("header"); var browser = navigator.appName; if (document.body.clientWidth < 780) { if (browser == "Microsoft Internet Explorer") { header.style.width = "780px"; } content.style.width = "635px"; } else { if (browser == "Microsoft Internet Explorer") { header.style.width = "100%"; } var width = document.body.clientWidth - 145; content.style.width = width + "px"; }}