By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,382 Members | 1,631 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,382 IT Pros & Developers. It's quick & easy.

Menu DHTML ?????

P: n/a
Moi
Hi i try to make simple DHTML menu but i have any little problem :-(
The problem is..... i hide the body of the menu when mouse is (normaly) out
of the body...but.... the event onmouseout is generated when the mouse out
from one of the entry of my menu......

someone can help me to understand why ?????

look this is my code:

<html>
<head>
<title>Document sans titre</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">

..ProMenu{
position:absolute;
left:100px;
top:100px;
width:200px;
height:66px;
z-index: 50;
visibility: visible;
}

..ProMenuHead {
position:relative;
left:0px;
top:1px;
width:200px;
height:22px;
z-index: 50;
visibility: visible;
background-color: #CCCCCC;
}

..ProMenuBody {
position:absolute;
background-color: #885599;
left:100px;
top:124px;
width:200;
padding-left:4;
padding-right:4;
padding-top:1;
padding-bottom:1
visibility;
z-index: 51;
visibility: hidden;
font-family: arial;
font-size: 12;
color: #ffffff;
z-index: 30;
}
..ProMenuBodyMask {
position:absolute;
background-color: #885599;
left:100-5;
top:122-22;
width:200+10;
height:400;
visibility:hidden;
font-family: arial;
font-size: 12;
color: #ffffff;
z-index: 48;
}

a.MenuPro
{
color:#ffffff;
text-decoration:none;
font-weight:bold;
}
a.MenuPro:hover
{
color:#ffffff;
text-decoration:underline;
font-weight:bold;
}

</style>

<script language="JavaScript1.2">
function Affiche(id) {
if (document.getElementById) {
document.getElementById(id).style.visibility="visi ble";
} else if (document.all) {
document.all[id].style.visibility="visible";
} else if (document.layers) {
document.layers[id].visibility="visible";
} }

function Masque(id) {
if (document.getElementById) {
document.getElementById(id).style.visibility="hidd en";
} else if (document.all) {
document.all[id].style.visibility="hidden";
} else if (document.layers) {
document.layers[id].visibility="hidden";
} }

</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>

<body>

<div id="Menu" class="ProMenu" >
<div id="Head" class="ProMenuHead" onMouseOver="Affiche('MBody');">
<div align="center"><strong><font
color="#FFFFFF">MENU1</font></strong></div>
</div>
</div>
<div id="MBody" class="ProMenuBody" onMouseOut="Masque('MBody');">
<p>
<a href="#" class="MenuPro">truc</a><br>
<a href="#" class="MenuPro">chose</a>
</p>
</div>
</body>
</html>

Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Wed, 2 Jul 2003 17:05:27 +0200, "Moi" <mo*@moi.com> wrote:
Hi i try to make simple DHTML menu but i have any little problem :-( <a href="#" class="MenuPro">truc</a><br>
<a href="#" class="MenuPro">chose</a>


The reader is going to have problems as well if there is no Javascript.
General rule: first get the HTML links right, then add the Javascript
decoration.

--
Stephen Poley
Barendrecht, Holland
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.