Hi, I try to create a menu for the website of my friend. But I have a probleme with the reaction of event. My submenu close when i quit the section div. Someone can help me please?
my code:
<html>
<head>
<title>test menu</title>
<script language="javascript">
function ouvrir_menu(cible){
liens_cible="liens"+cible;
document.getElementById(liens_cible).style.visibility="visible";
}
function fermer_menu(cible){
liens_cible="liens"+cible;
document.getElementById(liens_cible).style.visibility="hidden";
}
</script>
</head>
<body>
<div id="menu" style="position:relative;top:50px;width:200px;">
<div id="section1" style="width:200px;position:absolute;top:0px;background-color:grey;" onMouseOver="ouvrir_menu('1')">
Section 1
</div>
<div id="liens1" style="width:198px;height:40px;position:absolute;top:0px;visibility:hidden;z-index:2;border:1px solid red" onMouseOut="fermer_menu('1')">
<div style="position:relative;top:18px;background-color:lightgrey;">
Lien 1
</div>
</div>
</div>
</body>
</html>