Newbee question : same menu on pages with different backgrou

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
bobmorane
Beginner
Beginner
Posts: 1
Joined: Thu May 13, 2004 2:11 pm

Newbee question : same menu on pages with different backgrou

Post by bobmorane »

First of all please excuse me for my poor english.

On my site I have pages with black fonts on white background and pages with white fonts on black background. Of course I want my menu to be readable on every page, with the same fontcolor for the menu as in the rest of the page.
So do I have to make two menu_data.js files, e.g. menu_data_blackonwhite.js and menu_data_whiteonblack.js, just changing the menustyle in them (that means each time I want to change a word in a submenu I have to make exactly the same change in the other file) or is it possible to build this feature with only one menu_data.js ?

Thanks for your help.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Re: Newbee question : same menu on pages with different back

Post by John »

bobmorane wrote:First of all please excuse me for my poor english.
No! No excuse necessary, as I don't see anything at all wrong with your English. :D

Yes, I think you will need two _data files. With the situation of two menus on the same page you can use just one, but yours is a bit different - completely different menus depending on the page. The only differences would be in the style definitions as you mentioned, so it wouldn't be hard to build or maintain.
John
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

If you are using style sheets calling a different one for the black on white and white on black, then I believe you can do it using on and off class and only need one menu file. But, if you are not or if you are hard coding style into the head of each document then John's is the easiest solution. In the style sheet you would put a class for the color you want

Code: Select all

.mainOff {	background-color:#000000;
		color:#ffffff;
		border: 1px #ffffff solid;}
.mainOn{background-color:#ffffff;
		color:#000000;
		border: 1px #000000 solid;}
then in the menu_data.js file you would take out the off and on bgcolor off and on color and put in onclass="mainOn"; and offclass="mainOff"; leaving the rest of the style items as they are. That should work if css is an option.
My site uses this, but much more involved. If you click here and then just click the next button you will see the page colors change and the menu changes to match and I'm only using one data file, but hardcoding the class in each page. http://www.poems2u.com/text/index510-t.htm
Post Reply