Fonction hide sur un menudépliant

piregproduction Messages postés 5 Date d'inscription samedi 9 septembre 2006 Statut Membre Dernière intervention 5 novembre 2009 - 29 nov. 2008 à 13:36
piregproduction Messages postés 5 Date d'inscription samedi 9 septembre 2006 Statut Membre Dernière intervention 5 novembre 2009 - 1 déc. 2008 à 14:40
Bonjour j'ai un menu exactement identique a celui ci : http://tutorials.alsacreations.com/deroulant/menu-horizontal.htm
et je souhaiterai que le menu une fois déplié disparaisse si la souris sors du cadre déplié,
Quel code dois je rajouter au javascrip pour activer cette fonction ?

Merci :-)

3 réponses

piregproduction Messages postés 5 Date d'inscription samedi 9 septembre 2006 Statut Membre Dernière intervention 5 novembre 2009
29 nov. 2008 à 16:48
le code est exactement ça :




<?php header('Content-Language: en'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Horizontal expanding menu</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />


<script type="text/javascript">
<!--
window.onload=montre;
function montre(id) {
var d = document.getElementById(id);
 for (var i = 1; i<=10; i++) {
  if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
 }
if (d) {d.style.display='block';}
}
//-->
</script>




<style type="text/css">
<!--
/* CSS issu des tutoriels www.alsacreations.com/articles */
body {
margin: 0;
padding: 0;
background: white;
font: 80% verdana, arial, sans-serif;
}
dl, dt, dd, ul, li {
margin: 0;
padding: 0;
list-style-type: none;
}
#menu {
position: absolute;
top: 0;
left: 0;
z-index:100;
width: 100%;
}
#menu dl {
float: left;
width: 12em;
margin: 0 1px;
}
#menu dt {
cursor: pointer;
text-align: center;
font-weight: bold;
background: #ccc;
border: 1px solid gray;
}
#menu dd {
border: 1px solid gray;
}
#menu li {
text-align: center;
background: #fff;
}
#menu li a, #menu dt a {
color: #000;
text-decoration: none;
display: block;
height: 100%;
border: 0 none;
}
#menu li a:hover, #menu dt a:hover {
background: #eee;
}


#site {
position: absolute;
z-index: 1;
top : 70px;
left : 10px;
color: #000;
background-color: #ddd;
padding: 5px;
border: 1px solid gray;
}


a {text-decoration: none;
color: black;
color: #222;
}
-->
</style>
</head>





    * : [Alsacréations
/>
  [Explanations

>



</html>

Je pense que c'est au niveau du javascript qu'il faut rajouter une fonction :)
0
Bul3 Messages postés 4933 Date d'inscription samedi 1 juillet 2006 Statut Membre Dernière intervention 2 février 2015 16
1 déc. 2008 à 11:46
bonjour,
si les anciennes version des navigateurs t'importent peu,
aujourd'hui on fait en ccs sans javascript. exemple Menus En Css ici
Cordialement          [mon Site] [M'écrire] Bul         
0
piregproduction Messages postés 5 Date d'inscription samedi 9 septembre 2006 Statut Membre Dernière intervention 5 novembre 2009
1 déc. 2008 à 14:40
Un grand merci à toi pour ce tips :-)


Hiha !
0
Rejoignez-nous