Hey all, first post here :)Anyway, I've been developing a new site, however have been having trouble getting the navigation going.I know, CSS does this as well, however IE doesn't seem to recognise it, so I thought I'ld go for java script:
<div id="header"><ul><li class="onleft" onmouseover="whenHover('menuHome', 'onleft', 1);" onmouseout="whenDoneHover('menuHome', 'onleft', 1);" id="menuHome">Home</li><li onmouseover="whenHover('menuTitle', 'center', 1)" onmouseout="whenDoneHover('menuTitle', 'center', 1)" id="menuTitle" class="center">V-Ent.net<span id="menuTitlesub">The submenu!</span></li><li class="onright" onmouseover="whenHover('menuForum', 'onright', 1)" onmouseout="whenDoneHover('menuForum', 'onright', 1) "id="menuForum">Forum</li><br /><li class="onbottom" onmouseover="whenHover('menuAbout', 'onbottom', 1)" onmouseout="whenDoneHover('menuAbout', 'onbottom', 1) "id="menuAbout">About</li><li class="onbottom" onmouseover="whenHover('menuProjects', 'onbottom', 1)" onmouseout="whenDoneHover('menuProjects', 'onbottom', 1) "id="menuProjects">Projects</li><li class="onbottom" onmouseover="whenHover('menuFaq', 'onbottom', 1)" onmouseout="whenDoneHover('menuFaq', 'onbottom', 1)" id="menuFaq">FAQ</li><li class="onbottom" onmouseover="whenHover('menuContact', 'onbottom', 1)" onmouseout="whenDoneHover('menuContact', 'onbottom', 1)" id="menuContact" >Contact</li></div>
And the script (Which I believe is the issue):
function getElementByTagClass(tag, classN){ tags = getElementsByTagName(tag); for(i=0; i < tags.length; i++) { if(tags[i].className == classN) { return tags[i] } } return 0;}function showSub(id){ var d = document.getElementById(id+'sub'); d.style.display = "visible"; return false;}function hideSub(id){ var d = document.getElementById(id+'sub'); d.style.display = "none"; return false;}function whenHover(id, baseid, submenu=0){ var d = document.getElementById(id); if(baseid == 'onleft') { d.style.background-color = "#444444"; d.style.border-right = "5px solid #FFFFFF"; } if(baseid == 'onright') { d.style.background-color = "#444444"; d.style.border-left = "5px solid #FFFFFF"; } if(baseid == 'onbottom') { d.style.background-color = "#444444"; d.style.border-bottom = "5px solid #FFFFFF"; } if(submenu != 0) { showSub(id); } return false;}function whenDoneHover(id, submenu=0){ var d = document.getElementById(id); d.style.border-bottom = "2px solid #FFFFFF"; d.style.background-color = "#111111"; if(submenu != 0) { hideSub(id); } return false;}
I'm thinking it's either the script, or the fact that I've defined #header ul/li..Still, I'ld appreciate your help, as I haven't done Javascript for a while...