5
50295
Hi!
Javascript is doing something funny here. I expect that the onmouseout
handler "leave" should be called only when the mosuse has left the
entire list UL, but its triggered everytime, I move from one LI element
to the other. Why is this so?
Actually, I'm working on a collapsable menu (too long to post), and the
plan is to have make the onmouseout handler do the collapsing, and its
working excellently in IE, but not quite as well in NN, and FF.
Sometimes, the menu collapses when I move out, and at other times not.
Is there a Mozilla CSS fix for this? You know like -moz-user-select?
....
Thanks
- Olumide
////////////// HTML code ///////////////
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Untitled Document</title>
<script type="text/javascript">
function leave() {
alert("I left");
}
</script>
<STYLE>
li {
background-color: #FFFFFF;
font-weight: normal;
font-family: arial;
font-size: 12px;
text-align: center;
margin: 0;
padding: 0;
border: 1px solid black;
}
ul{
margin: 0;
padding: 0;
list-style: none;
width: 200px;
}
a {
display: block;
width: 200px;
text-decoration: none;
color: #000000;
}
</STYLE>
</head>
<body>
<ul onMouseOut="leave()">
<li><a href="#">Europe</a></li>
<li><a href="#">Africa</a></li>
<li><a href="#">America</a></li>
<li><a href="#">Asia</a></li>
</ul>
</body>
</html>
Javascript is doing something funny here. I expect that the onmouseout
handler "leave" should be called only when the mosuse has left the
entire list UL, but its triggered everytime, I move from one LI element
to the other. Why is this so?
Actually, I'm working on a collapsable menu (too long to post), and the
plan is to have make the onmouseout handler do the collapsing, and its
working excellently in IE, but not quite as well in NN, and FF.
Sometimes, the menu collapses when I move out, and at other times not.
Is there a Mozilla CSS fix for this? You know like -moz-user-select?
....
Thanks
- Olumide
////////////// HTML code ///////////////
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Untitled Document</title>
<script type="text/javascript">
function leave() {
alert("I left");
}
</script>
<STYLE>
li {
background-color: #FFFFFF;
font-weight: normal;
font-family: arial;
font-size: 12px;
text-align: center;
margin: 0;
padding: 0;
border: 1px solid black;
}
ul{
margin: 0;
padding: 0;
list-style: none;
width: 200px;
}
a {
display: block;
width: 200px;
text-decoration: none;
color: #000000;
}
</STYLE>
</head>
<body>
<ul onMouseOut="leave()">
<li><a href="#">Europe</a></li>
<li><a href="#">Africa</a></li>
<li><a href="#">America</a></li>
<li><a href="#">Asia</a></li>
</ul>
</body>
</html>