menu highlighting on viewed page (menu "memory")

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
User avatar
ronnie
Advanced
Advanced
Posts: 23
Joined: Wed Oct 22, 2003 8:46 am
Location: israel

menu highlighting on viewed page (menu "memory")

Post by ronnie »

well, what i mean to ask is this:
when clicking on a menu and after the page reloads, the menu shows the selected menu item in a different "on" style.

(e.g.: when clicking on "support/about milonic" at http://milonic.com, you will get the "support" and "about milonic" items highlighted on the menu).

it seems to me this works by using the page URL, since when opening the target in an iframe it doesn't remember my menu clicks. i'm using a custom made function which replaces the "openIFrame" function given on the site, so this could be the problem (donno, haven't tried openIFrame).

if this is indeed the solution, and since my custom made func does a little more than just handle clicks, would it be possible access the menu's memory property directly?

p.s. - couldn't find any documentation about this feature..


10x, r. ;)
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Can't do it, it depends on the URL of the page you are currently viewing. Updating the URL of the iframe won't tell the menu to change its highlighted menu item. I touched on this in this topic.... viewtopic.php?t=2959

But maybe someday...
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
ronnie
Advanced
Advanced
Posts: 23
Joined: Wed Oct 22, 2003 8:46 am
Location: israel

Post by ronnie »

heya,

you reckon there's some possible workaround here?
can't i "lie" to milonic about the URL or change the document URL w/o refreshing?

oh, what happens if i have the SAME URL in all menu items? will it highlight all of them or just the later one?


anyways, many thanks for the help,
r. :)
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Yes if you have all the URLs the same and you are currently viewing that URL, all the menu items that have matching URLs to the current will have highlights. This is because if you have a page listed in two menu items in two different menus on a page, both menu items will be highlight to let you know you can get to that page from either menu.

Regarding lying to it? Ehh, I am really not sure. I THINK the menu parses up the current page's URL at load time and then as it creates the menu's it changes the color of them based on the match. So I dont know if changing the page's URL after the fact will update the menu. Andy may have to chime in here to inform us of an API the menu may have exposed that would allow you to dynamically change the highlights. Like andy, is there a menu array index/position property that we can twiddle with to change whether a menu item is highlighted or not? Is so, then I think we may be able to dynamically change the colors of menu items on the fly! Wouldn't that be great.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
ronnie
Advanced
Advanced
Posts: 23
Joined: Wed Oct 22, 2003 8:46 am
Location: israel

Post by ronnie »

i'm counting on you here, boy!
nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy, nag Andy!

:D
Post Reply