Hello all javascript experts. I have a real problem on my hands and honestly, I’ve been trying to fix this for almost a year now. I’m trying to create a basic drop down menu using the onmousemouseover command. I dont have any problem getting the menu layer to appear when you move your mouse over the button and I can make the menu layer disappear when they move the mouse off the button. The problem is I want the menu layer to stay while they’re moving their mouse over it to make a choice.
The code I’m using is listed below.
Everything else works, the only problem I’m having is with the checkMenu function. All though I need this affect with 3 different menu layers I’ve been practicing with just one which I’ve given the ID “resources”. I think the problem is in the if statement. [B][SIZE=”4″]Why isn’t it working!!?
window.onload = initAll;
function initAll(){
document.getElementById(“resourcesbtn”).onmouseover = openMenu;
document.getElementById(“trainingbtn”).onmouseover = openMenuOne;
document.getElementById(“marketingbtn”).onmouseover = openMenuTwo;
document.getElementById(“resourcesbtn”).onmouseout = checkMenu;
document.getElementById(“trainingbtn”).onmouseout = checkMenuOne;
document.getElementById(“marketingbtn”).onmouseout = checkMenuTwo;
}
function openMenu(){
document.getElementById(“resources”).style.display = “block”;
}
function openMenuOne(){
document.getElementById(“training”).style.display = “block”;
}
function openMenuTwo(){
document.getElementById(“marketing”).style.display = “block”;
}
function checkMenu(){
if(document.getElementById(“resources”).onmouseover){
document.getElementById(“resources”).style.display = “block”;
}
else{
document.getElementById(“resources”)style.display = “none”;
}
}