Menu Ids

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
nsuk
Beginner
Beginner
Posts: 3
Joined: Tue Mar 23, 2004 7:24 am

Menu Ids

Post by nsuk »

I am wondering how you can access the menus using javascript. Basically I have a menu across the top of the page, and depending upon which area of the site you are in the relavent menu item has a background image (using css).

What I want to do is turn off the image when you mouse over another menu item, but return the image when you move away from the menu. I imagine that I simple want to write a javscript function that changes the css style of all menu items (apart from the mousedover one) but for this do I not need to know the menu id so that I can reference it.

I can email people the url of the site if they want to take a look but it is on my adsl machine so would rather not post it publicly.

Thanks

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

Post by Maz »

I'm thinking the closest built into the menu is onstyle and offstyle. Give these a name to reference in your style sheet.

Do check the milonic site for js references under support.
And search the forum for ideas on making js work.

maz
nsuk
Beginner
Beginner
Posts: 3
Joined: Tue Mar 23, 2004 7:24 am

Post by nsuk »

I have already looked over the site and the quick reference but can't seem to find anything. Do you have a link to where the documentation explains how the menu items are referenced.

I have already used the on/offstyle but I want to change the style for all menus apart from the current one the user is over, which this doesn't cover. I want to use on/off function and am happy to write the javascript but I need to know how to reference the menu items.

For example the menu is something like:

[products] | services | contact | about

where the user is currently in the products section of the website.

The user mouses over services and you get the following:

products | [services] | contact | about

however once he mousesout from services the menu returns to how it was before:

[products] | services | contact | about

I have used [] to indicate the use of a different css style
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

nsuk
Beginner
Beginner
Posts: 3
Joined: Tue Mar 23, 2004 7:24 am

Post by nsuk »

Yes, but that doesn't seem to help. All I want is to be able to do:

document.getElementById(FROM-MILONIC-SOMEWHERE).className but everything I have tried just bums out in the javascript with 'no attribute'.

I have tried _m[0][6]/_m[1][6] etc but apparently this is wrong.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

I'm not sure this will help, but it does talk about the internals of getting menus, by name, by object. etc.

http://milonic.com/forum/viewtopic.php?t=3632

Ruth
Post Reply