Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:36
Menu Ids
Poster: nsuk
Dated: Tuesday March 23 2004 - 6:42:56 GMT
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
Poster: Maz
Dated: Tuesday March 23 2004 - 6:59:29 GMT
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
Poster: nsuk
Dated: Tuesday March 23 2004 - 7:07:33 GMT
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
Poster: Maz
Dated: Tuesday March 23 2004 - 8:26:51 GMT
Did you look at these:
http://www.milonic.com/menu_methods.php
http://www.milonic.com/menu_variables.php
I can't help here.
maz
Poster: nsuk
Dated: Tuesday March 23 2004 - 16:05:05 GMT
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.
Poster: Ruth
Dated: Monday April 5 2004 - 16:32:22 BST
I'm not sure this will help, but it does talk about the internals of getting menus, by name, by object. etc.
http://www.milonic.com/forum/viewtopic.php?t=3632
Ruth