Image wrapping - vertical image/item height?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
ssalter
Advanced
Advanced
Posts: 12
Joined: Fri Jun 25, 2004 10:01 pm

Image wrapping - vertical image/item height?

Post by ssalter »

I never did get the dropshadow working that I posted about yesterday. Giving a plain white or black background, changing shadow colors, did not make a difference. However, that is trivial, I don't necessarily want to rely on the IE filters for effects.

I am playing with item images for the top level menu items. My style definition for the top level menus is:

Code: Select all

with(mainmenu=new mm_style()){
borderwidth=0;
onbgcolor="transparent";
oncolor="#ff0000";
offbgcolor="transparent";
offcolor="#000000";
padding=5;
fontsize="120%";
fontfamily="Verdana, Tahoma, Arial";
itemwidth=142;
imagewidth=142;
itemheight=23;
imageheight=23;
align="center";
}
I define the top level menu like this:

Code: Select all

with(milonic=new menuname("Main Menu")){
style=mainmenu;
position="relative";
alwaysvisible=1;
orientation="horizontal";
aI("text=Home;bgimage=off1.gif;overbgimage=over1.gif;");
aI("text=WebTools;showmenu=webtools;bgimage=off1.gif;overbgimage=over1.gif;");
aI("text=Departments;showmenu=departments;bgimage=off1.gif;overbgimage=over1.gif;");
aI("text=Resources;showmenu=resources;bgimage=off1.gif;overbgimage=over1.gif;");
}
Here are the off/over images:

Image
Image
What I get is this:

Image

The thin white line below each menu item is the top of a duplicate of each "off" image. I verified that by increasing the itemheight property to 50 which is over twice that of the image (142x23) and seeing a duplicate of the blank image below. So, it DOES appear to be wrapping. I am not sure what I am doing wrong since I specified both item and image dimensions.
ssalter
Advanced
Advanced
Posts: 12
Joined: Fri Jun 25, 2004 10:01 pm

Post by ssalter »

Nevermind, figured it out. I had a padding property of 5 which caused the malfunction. Actually, not a malfunction, the script did what I was telling it to do. I changed padding in the menu style to 2 and it looks most excellent now.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Glad to hear you figured it out on your own. Good feeling, yes? :D
John
ssalter
Advanced
Advanced
Posts: 12
Joined: Fri Jun 25, 2004 10:01 pm

Post by ssalter »

John wrote:Glad to hear you figured it out on your own. Good feeling, yes? :D
Yes, sure is. I probably should have kept trying before posting but I was at wit's end...or close to it. What a great menu, how long has it been around and how come I never encountered it before? :)
Post Reply