General discussion

Locked

Pop up menu visibility(with javascript)

By siamak604 ·
I've designed a menu,but I've a problem on controling the visibility of pop up lists.
You can see the same problem in dbai municipality site.(www.dm.gov.ae)
When I move mouse to the other part of form as the menu is visible,it should hide but I can't do that.Because each time I try to do this by losting focus from list's header list's visibility gets false.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Pop up menu visibility(with javascript)

by Bill_H In reply to Pop up menu visibility(wi ...

The placement of brackets in the 'dropit2' function is your first problem. Change the 'dropit2' function to:

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
themenu.style.top=
document.body.scrollTop+event.clientY- event.offsetY+20
if (themenu.style.visibility=="hidden")
{
themenu.style.visibility="visible"
themenu.style.zIndex=zindex++
}
}
else
{
hidemenu(whichone)
}
}

This will allow the dropdown menus to display consistently as the pointer is moved from menu to menu. However, a menu will then *remain* displayed even if the pointer is moved to another part of the form. To take care of this, modify the form definition to:

<form name="form" method="post" action="default.asp" name="form" onSubmit="if (this.key.value=='') {alert('Empty data is not acceptable ');return(false)}"
onmouseover="hidemenu()">

This will hide a displayed menu when the pointer is moved to a *non-menu* area on the form. This should give you the functionality you desire.

Collapse -

Pop up menu visibility(with javascript)

by siamak604 In reply to Pop up menu visibility(wi ...

Thank you very much,it helped me.

Collapse -

Pop up menu visibility(with javascript)

by siamak604 In reply to Pop up menu visibility(wi ...

This question was closed by the author

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums