Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hidemenu onmouseover body - how do I do it?

Status
Not open for further replies.

OKeddy

Technical User
Jul 13, 2001
24
GB
Hi I've recently managed to customise a drop-down menu which works a treat,the only thing that bugs me is the menu will only hide onclick of the body,I've tried changing the code to onmouseover the body to hide the menu but it disappears onmouseover the menu.
An example of what I want is at microsoft.com's site,the drop down menu's there disappear onmouseover or onmouseout.
Here's the code for the functions:

function dropit2(whichone){
if (window.themenu&&themenu.id!=whichone.id)
themenu.style.visibility="hidden"
themenu=whichone
if (document.all){
themenu.style.left=document.body.scrollLeft+event.clientX-event.offsetX-2
themenu.style.top=document.body.scrollTop+event.clientY-event.offsetY+18
if (themenu.style.visibility=="hidden"){
themenu.style.visibility="visible"
themenu.style.zIndex=zindex++
}
else{
hidemenu()
}
}
}

function dropit(e,whichone){
if (window.themenu&&themenu.id!=eval(whichone).id)
themenu.visibility="hide"
themenu=eval(whichone)
if (themenu.visibility=="hide")
themenu.visibility="show"
else
themenu.visibility="hide"
themenu.zIndex++
themenu.left=e.pageX-e.layerX
themenu.top=e.pageY-e.layerY+19
return false
}

function hidemenu(whichone){
if (window.themenu)
themenu.style.visibility="hidden"
}

function hidemenu2(){
themenu.visibility="hide"
}

if (document.all)
document.body.onclick=hidemenu

Thanks for your interest.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top