View Full Version : Switchcontent and Firefox alignment problem.

10-16-2008, 11:24 PM
1) Script Title: switchcontent

2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tchcontent.htm

3) Describe problem: Using switchcontent to hide menu ( vertical column style) / and Firefox
See: http://www.luz-info.com/indexfox.htm for an example of the 'problem'

I've had a good look around the forums for both CSS and Firefox, but am still unable to resolve my problem.
The link above is to a stripped down version of one of my pages with the stylesheet moved back into the html document to demonstate the 'problem'.

First of all I have used the switchcontent script from its very begining and it has served its purpose pefectly, doing everything I wanted it to, or so I thought......
Until I had a 'complaint' about my sites incompatability with Firefox.
Yes, I did develop the site in MS using F'page / Expression and I.E. and for 3years I've lived in ignorance thinking all was well.

I'm sure its not Switchcontent's script at fault but it does cause my problem.

My page has a left column vertical menu which can be shown / hidden by the switchcontent script by clicking on the red / blue text. I think it looks and works great in I.E. but have found in F/Fox & Opera the right column always sits below the left, not alongside.
In order for the main content ( right column ) to expand when the menu (left column ) is collapsed I've had to make its width:auto, as a fixed width defeats the object if the page does not take up the space used by the menu when it has been collapsed.

By specifying a fixed width for the right column I can make it peform partially correctly in F/Fox but it leaves an empty column space when the menu is collapsed. No good for me.
I've tried everything I can think of, floating left and right clearing l/r and both, margins and alignments but failed.
Can anyone help please?

10-17-2008, 12:59 AM
I'm not certain where you place the width, but have a try on this part:

float: left;
display: inline;
width: auto;
margin: 0 15px 10px 15px;

See if it helps.

10-17-2008, 05:38 PM
Thanks for the quick reply rangana.
Your suggestion only highlights the problem I'm facing.
If you set a fixed width to the right column (#content) it will not expand to take up the space left by the left column (#sidebar) when it it is collapsed.
Your suggestion leaves a space (equiv to the left column width ) to the right of the #content column (because its floated left). Float it right and the empty space is to the left of the #content column. So the auto setting seems to be the only way to make the right column dynamicaly expand as necessary.
Thanks for the input anyway.