Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

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:47

Menu Highlighting the currently selected page and ANCHORS


Poster: lpotter
Dated: Tuesday April 19 2005 - 18:42:39 BST

Refer to the Plain Text Horizontal Menu example to see what I'm describing if I don't explain it well enough.

I like the feature where the current selected page is highlighted in the menu, both at the menu level and at the page level.

There is one case where it does not work though.

If I have a link in a page like this:

<A HREF=sample.htm>go to sample</A>

The menu highlights the sample.htm menu selection - works great.

But linking to the page with an ANCHOR does not hightlight the menu item.

<A HREF=sample.htm#COME_HERE>go to sample</A>

I assume it's because the menu structure does not have a "sample.htm#COME_HERE" link, only a "sample.htm" link.

Is there a way around this problem? It would be nice if the menu looked for links to hightlight AFTER removing the "#COME_HERE" if it did not find an exact match.


Poster: Ruth
Dated: Tuesday April 19 2005 - 21:35:14 BST

Hi,

I'm not really sure I understand. If you already used the menu to get to the page, then the menu should be highlighted and should remain highlighted even if you click a link on the page to an anchor on that page.

You could also use pagematch and match the directory, then even with the anchor link clicked if the page is in the directory which you put in the menu link, it will highlight that menu item.

Ruth


Poster: lpotter
Dated: Tuesday April 19 2005 - 22:46:22 BST

If I use the menu to select a page, the menu highlights properly as I'd expect.

But if I select a LINK IN THE PAGE that takes me to another page (without the use of menu) the highlight DOES follow to the new page (really a cool thing)

UNLESS the link goes to an ANCHOR in the page, then the menu can't find a menu selection for the link with the anchor and then nothing is highlighted on the page.

<A HREF=sample.htm#GO_HERE>

will not highlight the menu selection for the sample.htm page.


Poster: Ruth
Dated: Wednesday April 20 2005 - 0:02:02 BST

If you put the page into the directory and then use pagematch= in the aI string, it will keep the highlighting. You can look at this site to see how it works. Highlighting menu from an html to a page outside the menu example

Mouseover About Us, then click on News Events on the submenu. When you get to that page, look at the left and see some html links. The top one is Archived, click it and then look at the menu, it will still have the About Us highlighted and teh News Events in the submenu highlighted, even though you got to the page through an html link and not the menu

The way this was done was to put this in the aI string for the newsevents link
Code:
aI("text=News & Events;url=/aboutus/newsevents/index.shtml;pagematch=/aboutus/newsevents/;");


The match is not to a page but directories....aboutus/newsevents and the page from the archive link is in that directory structure.

Ruth