Code: Select all
function mm_showMenu(menuName) {
if (arguments.length > 1) _m[getMenuByName(menuName)][8] = arguments[1];
popup(menuName);
}
function mm_hideMenu(menuName) {
var menuNum = getMenuByName(menuName);
if (arguments.length > 1) {
_m[menuNum][8] = arguments[1];
}
menuDisplay(menuNum, 0);
}
As per your post the other day concerning hiding and displaying different menus according to what is selected on a screen, I tried the above two functions without success.
Some background first. We have a design much the same as apple.com, where there are 'tabs' that generate the menu row. But unlike apple, we do not refresh the page each time a tab is clicked on, instead the row is shown right away, so all the menus are actually generated when the page is first loaded, and then only the appropriate menu is displayed according to what tab is set as the default.
We do not want to use the 'menu' for the tabs, instead those are already all setup through the use of li tags, and using netWindows to connect the events ( and of course css ). We instead just want the menu utilized for the menu 'row' underneath the tabs. What I'm having a problem doing is hiding a menu. You stated in that post that the element at position 8 of that array was the alwaysvisible flag, but when I check in the debugger there is an HTMLLIElement in that position, definitely not the alwaysvisible flag. So, how would I go about 'hiding' and 'displaying' a menu based on what is clicked. And I have tried the menuDisplay( <name>, <0,1> ) function and that doesn't seem to work either.
( in the index.html - right now just for simplicity sake )
Code: Select all
<script type="text/javascript">
with(milonic=new menuname("Main Menu")){
style=menuStyle;
top=10;
left=10;
alwaysvisible=1;
screenposition="center";
orientation="horizontal";
position="relative";
aI("text=Home;url=http://milonic.com/;status=Back To Home Page;");
aI("text=Menu Samples;showmenu=MySamples;");
}
with(milonic=new menuname("Financials")){
style=menuStyle;
top=10;
left=10;
alwaysvisible=1;
orientation="horizontal";
screenposition="center";
position="relative";
aI("text=Home;url=http://milonic.com/;status=Back To Home Page;");
aI("text=Samples2;showmenu=MySamples2;");
}
drawMenus();
</script>
and in my menu_data.js file
Code: Select all
_menuCloseDelay=500 // The time delay for menus to remain visible on mouse out
_menuOpenDelay=100 // The time delay before menus open on mouse over
_subOffsetTop=10 // Sub menu top offset
_subOffsetLeft=-10 // Sub menu left offset
with(menuStyle=new mm_style()){
onbgcolor="#4F8EB6";
oncolor="#ffffff";
offbgcolor="#DCE9F0";
offcolor="#515151";
bordercolor="#296488";
borderstyle="solid";
borderwidth=1;
separatorcolor="#2D729D";
separatorsize="1";
padding=5;
fontsize="75%"
fontstyle="normal";
fontfamily="Verdana, Tahoma, Arial";
pagecolor="black";
pagebgcolor="#82B6D7";
headercolor="#000000";
headerbgcolor="#ffffff";
subimage="images/arrow.gif";
subimagepadding="2";
overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color='#777777', Direction=135, Strength=5)";
outfilter="randomdissolve(duration=0.3)";
}
with(mySamples=new menuname("MySamples")){
style=menuStyle;
overflow="scroll";
aI("text=Horizontal Navigational Menu;url=/menusample1.php;");
aI("text=Vertical Navigational Menu;url=/menusample2.php;");
}
with(mySamples2=new menuname("MySamples2")){
style=menuStyle;
overflow="scroll";
aI("text=Horizontal Navigational Menu;url=/menusample1.php;");
}
So after seeing all that code, to hide the 'MySamples2' menu, should I not just call mm_hideMenu( "MySamples2" );?
Hopefully this makes some sense! And thanks for the help in advance!