why my javascript for menu doesn't work properly? (sth wrong withonMouseOut event)

P

Pawel_Iks

I have following xhtml doc with js code:

====================================================================
<html>
<head>
<style>
#menu1
{ display: block;text-decoration:none;}
#menu1:hover {color:red;}
#main_menu {border: 1px solid black;width:140px;height:
100px;display:none;}
</style>

<script type="text/javascript">

function rozwin() {
obj1=document.getElementById("main_menu");
obj1.style.display= "block";
}
function zwin() {
obj1=document.getElementById("main_menu");
obj1.style.display= "none";
}
</script>

</head>
<body>

<a id="menu1">Menu 1</a>
<div id="main_menu">
<ul id="submenu1">
<li >pozycja 1</li>
<li >pozycja 2</li>
<li>pozycja 2</li>
<li>pozycja 2</li>
</ul>
</div>

<script type="text/javascript">
document.getElementById("menu1").onmouseover=rozwin;
document.getElementById("main_menu").onmouseout=zwin;
</script>
</body>
</html>
====================================================================
and there is event: onmouseout event for div element with
id="main_menu", however, when the cursor is in the area of this div
the menu dissapear mysteriously ... I want to know why and where is
the problem?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top