PDA

View Full Version : trying to get a handle on DHTML



kargrafx
Sep 4th, 2004, 12:11 AM
Hi all. I want to set up a simple website, with 4 pages. I want a single DIV centered in the screen at any resolution, and at the top right have the 4 buttons for the pages; clicking the buttons would load a new page into the DIV.

I am thinking this can be done with the z position, and a single true webpage with the 4 DIV layers inside the main DIV which are moved up or down as the buttons are clicked. Am I right?

If so, how do I make sure the buttons are always on top? Can the buttons just be miniature DIV's themselves with a higher Z position? If so, how do I position them so that they are in the right spot inside the main DIV?

Also, how to I keep the main DIV always centered no matter the broswer size or type?

TIA!

mindlessLemming
Sep 4th, 2004, 12:39 AM
Don't bother with JS for this - it's not needed. Making core functionality with JS when it isn't required is bad, bad, bad...and it kills puppies.
Just make them seperate pages and include the similar elements (menu, header, footer,etc) with PHP or SSI includes. That way everyone can visit your site.

Do a search for 'centering CSS' - there are approx half a million pages explaining how to do it.