Forum Moderators: open
The main menu would essentially be a dummy menu, acting and looking like a link but not leading anywhere. I was also hoping to be able to have the currently 'active' item (that is, the item that has its submenu showing) use the 'on' graphic and a different pointer than the regular one for links. Similarily, when someone selects one of the items on one of the submenues, I'd like that item to act the same way.
Main Menu (abbreviated to just two items):
<div id="MenuMain">
<a href="Q&A.html" onmouseover="changeImages('main01','main01b')" onmouseout="changeImages('main01','main01a')"><img name="main01" src="Graphics/menu_main01a.gif" width="99" height="40" border="0" alt="Q & A" title="Q & A" /></a>
<a href="Theme.html" onmouseover="changeImages('main02','main02b')" onmouseout="changeImages('main02','main02a')"><img name="main02" src="Graphics/menu_main02a.gif" width="99" height="40" border="0" alt="Theme" title="Theme" /></a>
</div>
Submenus:
<div id="MenuQA">
<a href="FAQ/" onmouseover="changeImages('qa01','qa01b')" onmouseout="changeImages('qa01','qa01a')"><img name="qa01" src="Graphics/menu_qa01a.gif" width="99" height="40" border="0" alt="FAQ" title="FAQ" /></a>
<a href="SSM/" onmouseover="changeImages('qa02','qa02b')" onmouseout="changeImages('qa02','qa02a')"><img name="qa02" src="Graphics/menu_qa02a.gif" width="99" height="40" border="0" alt="So Spake Martin" title="SoSpakeMartin" /></a>
</div>
<div id="MenuTheme">
<a href="Concordance/" onmouseover="changeImages('qa01','qa01b')" onmouseout="changeImages('qa01','qa01a')"><img name="qa01" src="Graphics/menu_qa01a.gif" width="99" height="40" border="0" alt="Concordance" title="Concordance" /></a>
<a href="Encyclopaedia/" onmouseover="changeImages('qa02','qa02b')" onmouseout="changeImages('qa02','qa02a')"><img name="qa02" src="Graphics/menu_qa02a.gif" width="99" height="40" border="0" alt="Encyclopaedia" title="Encyclopaedia" /></a>
<a href="Heraldry/" onmouseover="changeImages('qa01','qa01b')" onmouseout="changeImages('qa01','qa01a')"><img name="qa01" src="Graphics/menu_qa01a.gif" width="99" height="40" border="0" alt="Heraldry" title="Heraldry" /></a>
<a href="History/" onmouseover="changeImages('qa02','qa02b')" onmouseout="changeImages('qa02','qa02a')"><img name="qa02" src="Graphics/menu_qa02a.gif" width="99" height="40" border="0" alt="History" title="History" /></a>
<a href="Maps/" onmouseover="changeImages('qa01','qa01b')" onmouseout="changeImages('qa01','qa01a')"><img name="qa01" src="Graphics/menu_qa01a.gif" width="99" height="40" border="0" alt="Maps" title="Maps" /></a>
</div>
Someone else suggested another piece of coding that I am trying to use, but so far my modifications haven't worked.
Javascript:
function CollapseAll() {
for (i=0; i<=Menu.length-1; i++) {
document.getElementById('Menu'+Menu[i]).style.display = 'none';
}
}function ToggleSub(MenuId) {
x = 'Menu'+MenuId;
CollapseAll();
document.getElementById(x).style.display = 'block';
}
Menu (changed to call the ToggleSub function):
<a href="#" onmouseover="changeImages('main01','main01b')" onmouseout="changeImages('main01','main01a')" onclick="ToggleSub('QA');"><img name="main01" src="Graphics/menu_main01a.gif" width="99" height="40" border="0" alt="Q & A" title="Q & A" /></a>
<a href="#" onmouseover="changeImages('main02','main02b')" onmouseout="changeImages('main02','main02a')" onclick="ToggleSub('Theme');"><img name="main02" src="Graphics/menu_main02a.gif" width="99" height="40" border="0" alt="Theme" title="Theme" /></a>
Linda_A it's absoulutely no working code. May be you can paste an example url here to undestand what you want to do, and we write you a needed code for this. If url would be cut off before we can see it, mail to me or Bernard and we can help you
Good luck!
var Menu = new Array("QA","Theme","Story","Miscellany");function CollapseAll() {
for (i=0; i<=Menu.length-1; i++) {
document.getElementById('Menu'+Menu[i]).style.display = 'none';
}
}
function ToggleSub(MenuId) {
x = 'Menu'+MenuId;
CollapseAll();
document.getElementById(x).style.display = 'block';
}
With that added back in, it works in Mozilla and IE. However, not in Opera (Opera doesn't hide the previous menu when you switch to a new one, just layers them on top of each other).
I hope it should work, if you have problem with document.layers, try to cut it off
Good luck to you