Using images in menu?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
User avatar
rudy
Mega User
Mega User
Posts: 161
Joined: Thu Jan 15, 2004 11:39 pm
Location: Scottsdale, Arizona
Contact:

Using images in menu?

Post by rudy »

Using version 5.33

http://www.networkdriven.com/qp/579bb62.html

I am using the

Code: Select all

subimage="/qp/arrow.gif";
in the style sectioin of the code, which puts a black right arrow in the main menu items at the very top of the menu and also the same black right arrow image in all submenu dropdowns. This all works fine, but what I would like to have is the top menu items with a different image than those in th submenu images as the black right arrow image. All the images must be right side of the text.

I tried to find a sample menu like the Milonic home page menu to see the code, as it has what I am looking to do, but couldn't find a sample like that. Any help would be appreciated.
Rudy
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Creat a new style for the submenu and place the style= with the new style name. Then add the new image url.

subimagealign="right"; places the image to the right.

Double check the style name, sometimes I have to look it up again.

maz
User avatar
rudy
Mega User
Mega User
Posts: 161
Joined: Thu Jan 15, 2004 11:39 pm
Location: Scottsdale, Arizona
Contact:

Post by rudy »

I'm sorry Maz, but I didn't grasp your reply, could you rough this out for me - sample

Maz wrote:Creat a new style for the submenu and place the style= with the new style name. Then add the new image url.

subimagealign="right"; places the image to the right.

Double check the style name, sometimes I have to look it up again.

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

Post by Ruth »

Since it seems all you are changing is the subimage, then you could do this

Code: Select all

windows98style1 =new copyOf(windows98style)
windows98style1.subimage="../qp/arrow.gif";
That would apply everything that is in the original style to the submenus including the subimage which you have listed, then in the original windows98style change that subimage to what you want it to be. Remember to go through and assign the windows98style1 to all the submenus. Here's some information about styles and creating more than one style [partII of the post] and using shortcut copyof method [partIII] of the post.

Ruth
User avatar
rudy
Mega User
Mega User
Posts: 161
Joined: Thu Jan 15, 2004 11:39 pm
Location: Scottsdale, Arizona
Contact:

Post by rudy »

I tried this Ruth but I don't think I wrote the code right - it didn't work.

Code: Select all

with(windows98style1=new copyOfwindows98style()){
withwindows98style1=subimage="..qp/arrow.gif";

with(windows98style=new mm_style()){
//with(windows98style1=subimage="..qp/arrow.gif";
onbgcolor="#000000";
oncolor="#FFFFFF";
offbgcolor="#FFAD73";
offcolor="#000000";
bordercolor="#BFBFBF";
borderstyle="raised";
borderwidth=2;
subimage="../qp/arrow.gif";
subimagepadding="2";
overfilter="Fade (duration=0.2);Alpha (opacity=90);Shadow(color=#777777', Direction=135, Strength=5)";
outfilter="randomdissolve(duration=0.3)";
separatorsize="2";
padding=4;
fontsize="75%";
fontfamily="tahoma, verdana";
headercolor="#FFAD73";
headerbgcolor="#000000";
high3dcolor="#eeeeee";
low3dcolor="#7F7F7F";
swap3d="1";
}
Ruth wrote:Since it seems all you are changing is the subimage, then you could do this

Code: Select all

windows98style1 =new copyOf(windows98style)
windows98style1.subimage="../qp/arrow.gif";
That would apply everything that is in the original style to the submenus including the subimage which you have listed, then in the original windows98style change that subimage to what you want it to be. Remember to go through and assign the windows98style1 to all the submenus. Here's some information about styles and creating more than one style [partII of the post] and using shortcut copyof method [partIII] of the post.

Ruth
[/code]
Rudy
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

The new code needs to go after the complete original definition (with(windows98style=new mm_style()){, etc.). Otherwise it has nothing from which to copy.
John
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Also, you didn't change the subimage so it will still be the same. The link to the Beginner's guide styles posts I gave would show the copyof would come after the original style.

Ruth
User avatar
rudy
Mega User
Mega User
Posts: 161
Joined: Thu Jan 15, 2004 11:39 pm
Location: Scottsdale, Arizona
Contact:

Post by rudy »

OK - I have a typical man mentality- only read the directions if all else fails.

Ruth, I read tye "style" link and followed the (well written) directions and low and behold, it works.

Take a look, please - let me know what you think:
http://www.networkdriven.com/qp/579bb62.html

Thanks, Ruth, John and Maz
Rudy
Post Reply