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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flyout Menu help 1

Status
Not open for further replies.

CTekMedia

Programmer
Oct 5, 2001
634
0
0
US
Hello all. I'm pretty weak when it comes to JS and I have been tasked with building a flyout menu for my company's public website:
I'm referring to the left column menu system.

Right now - if the mouse rolls over the large arrowhead a submenu opens up. To close the submenu, you have to then click on the small arrowhead in the submenu.

I would like the submenu to close if the mouse leaves the submenu DIV. I can attach the event handler to the DIV ok but regardless of what event handler I try OnMouseOut etc. the submenu won't close.

I really appreciate this forum and your help.

Cheers,

Bluetone
 
onmouseout is def what you want to use. By the looks of it, your code's been built in Dreamweaver so it's bit messyand hard to understand so here's an example of how to do it and hopefully you will be able to incorporate it into your code.

Code:
function HideDiv(which){
document.getElementById(which).style.visibility='hidden'
}

then

Code:
<div id="div1" onmouseout="HideDiv(this.id);">
your menu
</div>

now, as a side note... I've sometimes found that moving the mouse out of an active element can sometimes make it do some erratic things. I generally place a larger transparent div under the sub menu and detect the mouseover/out event on that.

Give the above a go and see how you get on.

Cheers

Nick
 
Thanks for the reply! I'll work on it today.

Cheers,

Bluetone
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top