PDA

View Full Version : How to make window size determine page layout?


kirby
03-17-2005, 10:34 PM
Please have a look at this page:

http://nero.com/us/index.html ('http://nero.com/us/index.html')

My monitor is 1280x768. At full screen, the page is divided into three columns. If I shrink my window, the page automatically eliminates column number 3. Can anyone tell me how they did this? Also, will this work reliably on different browser versions?

Thanks

gmcrone
03-17-2005, 10:43 PM
They are using a custom javascript that uses a different css style sheet based on the browsers window size.

Mike...

kirby
03-20-2005, 02:21 AM
Thanks.. Are there any pre-made scripts for this or do you know how to do this? I have no idea where to start :unsure:

domedia
03-20-2005, 04:19 PM
If you view source you'll find the path to the javascript http://ww2.nero.com/js/lib.js ('http://ww2.nero.com/js/lib.js').
That javascript is using the Document Object Model (DOM) to set style for certain CSS elements, in this case div id container.
In source you'll also see how the javascript function is called: <script language="javascript" type="text/javascript">AdjustWidth();</script>

Not hard to do if you know how, but if you don't know javascript, I would forget about it.

kirby
04-17-2005, 07:02 AM
I saved all the source files to my computer, but when I open it in Dreamweaver, it causes DW to crash. Is there a tutorial for this sort of thing somewhere?

I wonder if someone wouldn't mind building a simple template for everyone to use?

Thank you for all your help.

domedia
04-17-2005, 06:30 PM
You'd have to learn javascript/css pretty good to handle this stuff. This is not plug-and-play. Unless you know JS/DOm, I'd stay away from it.