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

Item menu highlight not working properly


Poster: kilkul
Dated: Wednesday October 20 2004 - 14:59:18 BST

Though you've added a sample for the <b><i>clickfunction</i></b> property in the FAQ page, along with the <b><i>highlightme()</i></b> function, for those who had problems using the current page tracking feature when using iframes, the only thing that it does is changing the item's background color, leaving it like that even if another item has been clicked. This method does not recursively highlight all the menu items (if, let's say, you're in the 4th sublevel, all the parent items should be distinctly coloured). Is there a way this can be done, or should I try to come up with a custom function of my own?

Thanks.


Poster: kevin3442
Dated: Friday October 22 2004 - 18:44:54 BST

Hello,

The subject line you wrote for this topic is: "Item menu highlight not working properly". I beg to differ. The highlightme() function does work properly. It does exactly what it was written to do and works exactly as described in the FAQ. While it's true that it doesn't do what you have in mind, that doesn't mean that it doesn't work properly. That may seem picky, but I just wanted to make clear to any future readers that the highlightme() function does work as it was intended.

kilkul wrote:
Is there a way this can be done,...[?]

There is no built-in functionality to do what you'd like.
kilkul wrote:
...or should I try to come up with a custom function of my own?

That would be the only option available, as far as I know. Sorry the news isn't better. If you were to write such a function, others would undoubtedly find it useful.

Kevin


Poster: akirk
Dated: Wednesday October 27 2004 - 17:42:49 BST

Have you found a solution to this? I am interested in the same kind of highlighting. The old version of the highlightme() function that was posted, turned off the previously-highlighted item, and only kept the active item highlighted. I would like to get back to this functionality. My old functionality broke with the new version.
:cry:

Thanks!


Poster: kevin3442
Dated: Monday November 1 2004 - 20:15:04 GMT

Hi,

Sorry for the delayed reply... was on the road all week and didn't have a chance to get in the forums.

I messed around with this a little over the weekend and came up with a function that you could use to emulate the page matching option. Here's the code:
Code:
// EDIT THESE TWO VARIABLES AS PREFERRED //

var mm_closeBcMenus = true;
var mm_highlightParentItems = true;

///////////////////////////////////////////

var mm_breadCrumbAnchor = -1;

function mm_breadCrumbs()
{
  var selectedItem = _itemRef;
  var i = mm_breadCrumbAnchor;

  if (mm_closeBcMenus) closeAllMenus();

  if (i > -1) {
    do {
      _mi[i][7] = _m[_mi[i][0]][6].offbgcolor;
      _mi[i][8] = _m[_mi[i][0]][6].offcolor;
      BDMenu(_mi[i][0]);
      i = getParentItemByItem(i);
    } while (!isNaN(i) && mm_highlightParentItems);
  }

  i = mm_breadCrumbAnchor = selectedItem;
  do {
    _mi[i][7] = _mi[i][19];
    _mi[i][8] = _mi[i][18];
    BDMenu(_mi[i][0]);
    i = getParentItemByItem(i);
  } while (!isNaN(i) && mm_highlightParentItems);
}

To implement this function:

(1) Place the above code at the top of your menu_data.js file.

(2) Define the two user variables - mm_closeBcMenus, and mm_highlightParentItems - at the top of the menu_data.js file according to the following descriptions:

mm_CloseBcMenus - Set to true if you want your submenus to close after a menu selection is made. Set to false to leave submenus open after a menu selection is made.

mm_highlightParentItems - Set to true if you want the selected item and all of its parent items (back to the main menu) to be highlighted. Set to false if only want the selected item to be highlighted.

(3) Call the mm_breadCrumbs() function from a menu item, using the menu item's clickfunction property, as shown in the following examples:
Code:
aI("text=Item Text;showmenu=subMenuName;clickfunction=mm_breadCrumbs();");
aI("text=Item Text;url=thePageToLoad.html;clickfunction=mm_breadCrumbs();");

I've posted a demo page with explanations and a downloadable sample here.

Hope that helps,

Kevin