JavaScript Menu, DHTML Menu Powered By Milonic
Demo - mm_changeItemProperty Function
for use with Milonic Solutions' DHTML Menu V5
To test click the Drag off/on. When Drag Mode is On move the menu anywhere you want.

This sample demo was created in reference to this thread in the Help and Support for Version 5

The function.

This function applies to the properties of items, i.e. onbgcolor, offbgcolor, url, decoration, font, text, type, etc.  It will find the item you list and change the property you have specified for that item.


function mm_changeItemProperty(menuName, itemName, codeRef, newValue, updateDisplay)
{
  menuName = menuName.toLowerCase();
  for (i=0; i<_mi.length; i++)
    if (_mi[i][1].replace(/\ \;/ig,' ') == itemName && _m[_mi[i][0]][1] == menuName) break;
  if (i == _mi.length) return;
  _mi[i][codeRef] = newValue;
  if (updateDisplay) BDMenu(_mi[i][0]);
}

The parameters.

 mm_changeItemProperty() is the function name. It takes five [5] parameters.

Demo - Dynamic Drag

Instructions


  1. Download the dragdrop.js module not included in the sample.

  2. Download the dynamic drag sample and open the dynamic_drag_data.js file.

  3. Create your own style with the desired colors, fonts etc.

  4. Do NOT modify the first or last item except for the onbgcolor, offbgcolor, offcolor, oncolor of the first item which you can change to match your style colors. These two items are an integral part of the functions. For example, if you changed Drag Mode: <b>Off</b> in item 1 to something else, the function would be looking for Drag Mode: <b>Off</b>:

    mm_changeItemProperty('main','Drag Mode: Off',86,true,0);

    Not finding the words specified in the function, it will not work.

  5. Add your own items [in between the first and last ones, and your own submenus.

  6. Call the file as you would any menu_data.js file.

More Demos

These demos have been created placing the function directly on the web page. Placing the function on a page limits the change to that page.

DHTML Menu courtesy of Milonic Solutions

Download  mm_changeItemProperty  sample and the  dragdrop.js  module [not included in sample]