Mixing bgimage and onbgcolor/offbgcolor

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
rbinse
Beginner
Beginner
Posts: 2
Joined: Thu Jul 22, 2004 3:22 pm

Mixing bgimage and onbgcolor/offbgcolor

Post by rbinse »

I've a little problem : I use a transparent image to make round corner on main menu item. I specify a onbgcolor and a offbgcolor. The problem is that the offbgcolor never comes back after selecting the main item.

Do I something wrong ?

http://coaching.cadresonline.com/colmilonic/menu.htm

Here is my code :

Code: Select all

with(menuStyle=new mm_style()){
onbgcolor="#AC0C01";
oncolor="white";
offbgcolor="white";
offcolor="#515151";
separatorcolor="#000000";
separatorsize="2";
fontsize="11px";
fontstyle="normal";
fontfamily="Arial";
align="center";
bgimage="bgd_onglet_118.gif";
itemheight="18px";
itemwidth="118px";
}

Code: Select all

with(milonic=new menuname("Main Menu")){
style=menuStyle;
top=10;
left=10;
alwaysvisible=1;
orientation="horizontal";
aI("text=ACCUEIL;bgimage=bgd_onglet_73.gif;itemheight=18px;itemwidth=73px;url=http://www.cadresonline.com/;status=CadresOnline;");
aI("text=LES OFFRES;showmenu=Offres;");
aI("text=L'ACTUALITE;showmenu=Actualite;");
aI("text=LE COACHING;showmenu=coaching;");
aI("text=CREER MON COMPTE;showmenu=creercompte;onbgcolor=#C3CB63;");
aI("text=ESPACE RECRUTEUR;showmenu=recruteur;");
}
rbinse
Beginner
Beginner
Posts: 2
Joined: Thu Jul 22, 2004 3:22 pm

Post by rbinse »

no idea ???
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Is think you need an overbgimage with the rounded corners to switch the background.

maz
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Yes, Maz is correct you need an overbgimage. But that still won't solve the problem, I tried it. The solution I found was to make the bgimage and overbgimage non transparent. That would mean you need two bgimages one 118px and one 73px, and three overbgimages, two 118px and one 73px. The third one you'd make green for the item you want to be green in mouseover.

One thing to remember, bgimages repeat. You have itemwidth and height set and if text size is increased in Netscape it won't make the items wider but it will make them higher and that forces the background image to repeat. You can avoid that by making the image about 100px high. The file size remains the same 1px. Hope that helps. If you need the images, I have them since I made them to test things.

Ruth
Post Reply