Code: Select all
with(milonic=new menuname("facility")){
style=VHRC_sub_menu_style;
top="offset=+4";
aI('text=Directions;url=/inside/facility/directions.html;');
. . .
}
Code: Select all
with(milonic=new menuname("facility")){
style=VHRC_sub_menu_style;
top="offset=+4";
aI('text=Directions;url=/inside/facility/directions.html;');
. . .
}
NP... it's not like I actually replied early last week either! Holidays have been very busy indeed so far.JMM wrote:Thanks for the replies, sorry I let this lapse.
You can change the position of the menu programatically after it has been rendered. But, if you can figure out the desired location before the menu is rendered, as you did, I think that's the better approach. If you do it after the menu is already visible, then the user may see the menu appear briefly and then change locations; visually better to avoid this "jump" effect if you can....Everything about the menu would be the same except for the positioning, as controlled by the top and left properties, so I was hoping I could load the same menu data file for both designs and then just change those properties before drawing the menus. I ended up setting those top and left values in the menu data file with a variable, which I assigned a value to just before the code calling for the menu data file.
Programatically adding items is something I have yet to figure out. But I can help you with removing items.The other specific thing I was interested in was adding / removing menu items after initially defining the menu. It was the same situation, I wanted to use the same menu as part of two different designs, but on the homepage of the site I didn't want a link to "Home" and on the other pages I did...
Code: Select all
function mm_getItemByName(itemName)
{
for (i=0; i<_mi.length; i++) if (_mi[i][1].indexOf(itemName) != -1) return i;
return -1;
}
function mm_removeItem(itemName)
{
var itemNum = mm_getItemByName(itemName);
if (itemNum == -1) return;
var idx = 0;
newItemArr = new Array();
for (i=0; i<_m[_mi[itemNum][0]][0].length; i++) if (_m[_mi[itemNum][0]][0][i] != itemNum) newItemArr[idx++] = _m[_mi[itemNum][0]][0][i];
_m[_mi[itemNum][0]][0] = newItemArr;
BDMenu(_mi[itemNum][0]);
}
Code: Select all
aI("text=Home;url=index.html;status=To the home page;");
Code: Select all
mm_removeItem('Home');