PDA

View Full Version : How to keep one part of the page fixed while others change



mypointofview
Aug 12th, 2009, 11:48 AM
Hi, I have a vertical navigation at left and a content area at right. The navigation does not change but when I go to another page of my site, the navigation shortly goes away and doesn't stay visible uninterrupted.

Here's my site: http://moourl.com/myzn3

But here's a site where this "shortly-disappearing-of-the-navigation" does not happen at all: http://www.phplist.com/

How can I make it that my navigation area stays uninterrupted on screen even if changing page?

I'm using PHP code to colorize the current page name in the navigation. So the code changes - I assume that's why it needs to disappear shortly?

I know that my code has two beauty marks: I don't use list for the navigation and also I (partly) use tables (to be IE compatible for now) -- the other site uses <li> and only div's.

Thanks,

-Martin

abduraooft
Aug 12th, 2009, 11:59 AM
You'd need to use fixed position, but IE6 doesn't support it normally. Read http://www.cssplay.co.uk/layouts/fixed.html

mypointofview
Aug 12th, 2009, 12:50 PM
Thank you. I use "position" in a special .css file that cascades last, after sniffing the screen size.

Here's what I have for example for a large screen:


td.navigationtable { position: absolute; left: 5%; z-index: +1; } /* z-index +1 so that editorial cannot overlap the links at left */
td.editorialtable { position: absolute; left: 18%; }

The navigation does not jump and appears immediately at left. But still -- it disappears shortly together with the main content when I navigate to another page.

Possibly if I'd disable the color indicator of the current page it would be the same code (therefore remaining in cache because it comes as a php include), but I like the color indicator.

Is there some other way? I looked into iFrames, read about Ajax, etc... but it sounds like overkill and very complex to me.

Thank you, -Martin