edgework
03-03-2003, 09:01 PM
When I studied web programming, the curriculum was extremely Windows-centric. Thus, it's not surprising that this problem doesn't appear in IE 6; only Mac IE 5.1. I'll attempt to be brief as possible and still convey the main issues.
I have a straightforward set of drop-down menus in my top level navigation bar. As this appears on all pages, I placed the entire batch of code in a Javascript variable called topMen and call it with a document.write() command within each page.
Initially it worked as expected. An early version can be seen at http://edgework.tripod.com/
Links for Air Filters, Water Filters, and Products trigger drop-down menus, the delay feature allows enough time for the mouse to move to the links, and when the mouse moves off the menu, the menu is once more hidden.
When I began working with DreamweaverMX, I recoded the pages to XHTML, using Dreamweaver's convert feature to get me started, and lots of trial and error to finish the job. This is still ongoing, but at the moment, the pages validate as XHTML Transitional. The drop-down menus still work as expected in Windows IE6, but on Mac IE5.1 they have turned buggy.
The latest version is at http://209.61.203.61
The initial mouseover event is triggering the drop-down menus, but the onmouseout events are having no effect, and the process of delaying the hide trigger is completely screwed up. Here's the relevant code, restricted to the Air Filters menu.
var topMen;
var menus = new Array();
var menu=null;
var onmenu=false;
var onlinks=false;
var activemenu=null;
var timr;
topMen="<div id='navbar'>"
topMen+="<div id='homeLink'>"
topMen+="<p><a href='index.html' onfocus='blur();'>Home</a></p>"
topMen+="</div>"
topMen+="<div id='airLink'>"
topMen+="<p><a href='#' onmouseover='showmen(\"air\");' onmouseout='hide_delay();'onfocus='blur();'>Air Filters</a></p>"
topMen+="</div>"
...and the div with enclosed menu links...
topMen+="<div id='airmenu' onmouseover='onmenu=true;' onmouseout=' onmenu=false; hide_delay();'>"
topMen+="<div class='menu' id='airmen' onmouseover='onlinks=true;' onmouseout='onlinks=false;'>"
topMen+="<p class='firstp'><a href='aair.html'>Aller Air</a></p>"
topMen+="<p><a href='amair.html'>Amaircare</a></p>"
topMen+="<p><a href='ahair.html'>Austin Healthmate</a></p>"
topMen+="<p><a href='bair.html'>Blueair</a></p>"
topMen+="<p><a href='iqair.html'>IQ Air</a></p>"
topMen+="<p><a href='norair.html'>Northern Air</a></p>"
topMen+="</div>"
topMen+="</div>"
...the functions that show and hide the menus...
function showmen(menChoice) {
menu=menus[menChoice];
if (activemenu != null && menu != activemenu){
clearTimeout(timr);
activemenu.style.visibility="hidden"
}
clearTimeout(timr);
menu.style.visibility="visible";
activemenu=menu;
}
function hide_delay() {
if (onmenu || onlinks) {
menu.style.visibility="visible";
return true;
}
timr=setTimeout("closeMenu()",200);
}
function closeMenu(){
if (onmenu || onlinks) {
return;
}
else{
activemenu.style.visibility="hidden";
}
}
...and finally, the init fuction that loads the array and sets the initial visibility value to hidden...
function init() {
menus["air"]=document.getElementById("airmenu");
menus["air"].style.visibility="hidden";
menus["water"]=document.getElementById("watermenu");
menus["water"].style.visibility="hidden";
menus["prod"]=document.getElementById("prodmenu");
menus["prod"].style.visibility="hidden";
}
It seems that something is going missing since I switched to XHTML Transitional, but I don't know what it might be.
Yes, I know that Netscape doesn't respond to this script at all. I was getting ready to decipher that problem when I got sidetracked by this one.
Any advice will be greatly appreciated.
Thanks
I have a straightforward set of drop-down menus in my top level navigation bar. As this appears on all pages, I placed the entire batch of code in a Javascript variable called topMen and call it with a document.write() command within each page.
Initially it worked as expected. An early version can be seen at http://edgework.tripod.com/
Links for Air Filters, Water Filters, and Products trigger drop-down menus, the delay feature allows enough time for the mouse to move to the links, and when the mouse moves off the menu, the menu is once more hidden.
When I began working with DreamweaverMX, I recoded the pages to XHTML, using Dreamweaver's convert feature to get me started, and lots of trial and error to finish the job. This is still ongoing, but at the moment, the pages validate as XHTML Transitional. The drop-down menus still work as expected in Windows IE6, but on Mac IE5.1 they have turned buggy.
The latest version is at http://209.61.203.61
The initial mouseover event is triggering the drop-down menus, but the onmouseout events are having no effect, and the process of delaying the hide trigger is completely screwed up. Here's the relevant code, restricted to the Air Filters menu.
var topMen;
var menus = new Array();
var menu=null;
var onmenu=false;
var onlinks=false;
var activemenu=null;
var timr;
topMen="<div id='navbar'>"
topMen+="<div id='homeLink'>"
topMen+="<p><a href='index.html' onfocus='blur();'>Home</a></p>"
topMen+="</div>"
topMen+="<div id='airLink'>"
topMen+="<p><a href='#' onmouseover='showmen(\"air\");' onmouseout='hide_delay();'onfocus='blur();'>Air Filters</a></p>"
topMen+="</div>"
...and the div with enclosed menu links...
topMen+="<div id='airmenu' onmouseover='onmenu=true;' onmouseout=' onmenu=false; hide_delay();'>"
topMen+="<div class='menu' id='airmen' onmouseover='onlinks=true;' onmouseout='onlinks=false;'>"
topMen+="<p class='firstp'><a href='aair.html'>Aller Air</a></p>"
topMen+="<p><a href='amair.html'>Amaircare</a></p>"
topMen+="<p><a href='ahair.html'>Austin Healthmate</a></p>"
topMen+="<p><a href='bair.html'>Blueair</a></p>"
topMen+="<p><a href='iqair.html'>IQ Air</a></p>"
topMen+="<p><a href='norair.html'>Northern Air</a></p>"
topMen+="</div>"
topMen+="</div>"
...the functions that show and hide the menus...
function showmen(menChoice) {
menu=menus[menChoice];
if (activemenu != null && menu != activemenu){
clearTimeout(timr);
activemenu.style.visibility="hidden"
}
clearTimeout(timr);
menu.style.visibility="visible";
activemenu=menu;
}
function hide_delay() {
if (onmenu || onlinks) {
menu.style.visibility="visible";
return true;
}
timr=setTimeout("closeMenu()",200);
}
function closeMenu(){
if (onmenu || onlinks) {
return;
}
else{
activemenu.style.visibility="hidden";
}
}
...and finally, the init fuction that loads the array and sets the initial visibility value to hidden...
function init() {
menus["air"]=document.getElementById("airmenu");
menus["air"].style.visibility="hidden";
menus["water"]=document.getElementById("watermenu");
menus["water"].style.visibility="hidden";
menus["prod"]=document.getElementById("prodmenu");
menus["prod"].style.visibility="hidden";
}
It seems that something is going missing since I switched to XHTML Transitional, but I don't know what it might be.
Yes, I know that Netscape doesn't respond to this script at all. I was getting ready to decipher that problem when I got sidetracked by this one.
Any advice will be greatly appreciated.
Thanks