Hi Ruth,
You're confusing the function definition with the function call and sort of mixing them together. The function is
defined (in this case, at the top of your .js file) like so:
Code: Select all
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]);
}
Thenames of the five parameters are menuName, itemName, codeRef, newValue, and updateDisplay. They need to stay that way throughout the entire function definition.
When you call the function (i.e., when you want to actually use it), you "pass" values into these parameters for the function to use. A function call might look like this:
Code: Select all
mm_changeItemProperty('mainmenu','Products',55,120,1);
Now, the function would look for a menu item named "Products" in the menu named "mainmenu" and change its itemwidth (codeRef 55) to a new value of 120; the last parameter, a 1, forces the change to take effect immediately.
Your function calls, from the onfunction/offfunction properties of a menu item, would be as illustrated in my previous post. You pass the name of the menu, the text in the menu item you want to change, a codeRef of 1 because thats the code for the
text poperty, the new text you want to use, and a 1 to force the change. The tricky par for you is that the onfunction use passes the original text followed by the new text. But the offfunction must now look for the new text since it has changed) and pass the new text followed by the original text. Your MENU/^TOP item would look like this:
Code: Select all
aI("text=MENU;url=#top;onfunction=mm_changeItemProperty('main1','MENU',1,'^TOP',1);offfunction=mm_changeItemProperty('main1','^TOP',1,'MENU',1);");
(note that the last time I posted this example, I got the next-to-last semicolon in the wrong place, which probably would have completely prevented the menus from appearing... sorry
).
I had a look at your menu code (using the 12-2003.js file from the first example you posted a URL to). I've modified that file and
posted it here. The approach works well for he two simple menu items. However, that last one -- the one with the praise for Milonic Menus -- might be a bit trickier since it has so much text and html code in the text= property (I can see why Dave took the approach he did). For now, I just made the last bit (the part that changes with a mouseover) a separate item in that menu. Probably not what you're looking for though. If not, give a holler and we'll see what else we can whip up.
Kevin