Hi Venky,
I'm thinking that you could do what you want by programatically changing the
offbgcolor of the specific menu item when the page in question loads. To do this, you need to
(1) figure out the unique item index for the menu item in question and
(2) change the
offbgcolor property for that item when the page loads. I have been playing with some methods of dynamically changing menu item properties and menu properties programatically. I have two functions that you could use. They are:
Code: Select all
function mm_getItemByName(menuName, itemName)
{
menuName = menuName.toLowerCase();
for (i=0; i<_mi.length; i++)
if (_mi[i][1] == itemName && _m[_mi[i][0]][1] == menuName) return i;
return -1;
}
function mm_changeItemProperty(menuName, itemName, codeRef, newValue)
{
var itemNum = mm_getItemByName(menuName, itemName);
if (itemNum == -1) return;
_mi[itemNum][codeRef] = newValue;
BDMenu(_mi[itemNum][0]);
}
You could include these functions at the top of your /newlayout/template/menu_data4.js file, or (since they'll only be used on one page) put them in a separate .js file that you source into your
http://www.kamakoti.org/hindudharma/foreword.html page. The function that you will use directly is as follows:
mm_changeItemProperty(menuName, itemName, codeRef, newValue)
This function takes four parameters.
(1) menuName is the name of the menu containing the item you want to change; this name is given in the code that creates the menu. It is
not case sensitive. For example, your main menu is created with the following code:
Code: Select all
with(milonic=new menuname("Main Menu")){
style=menuStyle;
top=60;
.
.
.
}
The name of the menu is given in the first line as 'Main Menu'.
(2) itemName is the name of the item whose properties you want to change. Since there is no internal item name, I use the
text that appears in the menu item, and so the
itemName is given in the
text= property of the aI() function that defines the menu item. It
is case sensitive. So, for example, in your 'Main Menu', you have a 'Downloads' item defined like so:
Code: Select all
aI("text=Downloads;showmenu=Audio;");
The
itemName of this menu item is therefore 'Downloads'. Again, it
is case sensitive.
(3) codeRef is the number or "code reference" of the property that you want to change. Each menu item property has a unique "code reference" number; these numbers are found in the "Code Ref" column of the table that lists the menu item properties on the
quickrefs page for menu item properties. For example, the
codeRef for the
offbgcolor is 7.
(4) newValue is the new value that you want to assign to the identified menu item property, for the targeted menu item. This might be a numeric or a string value, depending on what type of property you are changing (a color would be a string).
For example, the
offbgcolor for the items in your 'Main Menu' is defined in your current
menuStyle as "#ffffff". Suppose you wanted to to change the
offbgcolor of the 'Downloads' item in the 'Main Menu' to "#F26E26" (the
pagebgcolor from the same style). You could do this with the following function call:
Code: Select all
mm_changeItemProperty('Main Menu','Downloads',7,'#F26E26');
To get that to happen automatically when the page loads, you'd call the function in your html code, using the body's onload event, like so:
Code: Select all
<body onload="mm_changeItemProperty('Main Menu','Downloads',7,'#F26E26');">
It seems like a lot just to get one item's background color to change, but it's really more difficult to explain than it is to implement. I hope it made sense!
Note to anyone else who is interested... In theory, the above
mm_changeItemProperty() function can be used to change
any menu item property. But there are over 70 item properties, and I haven't tested them all! So far, however, my tests look good, having changed the menu item's various colors, width, justification, url, text, showmenu, and others. Note, however, that I have only tested these in IE6, NS7, and OP7.2 under Win2k, so there're lots of other browser/os combinations I have yet to test. If you test the functions successfully in other browser/os combos, please let me know!
Hope that helps,
Kevin