1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
<script type="text/javascript">
function menuDeroulant (indice,left,top,lien,tableau) {
this.indice=indice;
this.id=genericID+indice;
this.left=left; //position absolue LEFT
this.top=top; //position absolue TOP
this.lien=lien;
this.tableau=tableau;
this.printCadre=afficheDivMenu;
this.printMenu=afficheListe;
}
function afficheDivMenu() {
document.write("<div id=\"",this.id,"\" style=\"position:absolute;left:",this.left,"px;top:",this.top,"px;background:pink;z-index:5;height:500px;\" onMouseOut=\"javascript:clearAll();\"></div>");
}
function afficheListe () {
document.getElementById(this.id).style.display='block';
var txtHTML="";
for (var i=0;i<=this.tableau.length;i=i+2) {
txtHTML=txtHTML+"<a href=\""+this.tableau[i+1]+"\" style='display:block;z-index:1;background:yellow;'>"+this.tableau[i]+"</a><br />";
}
document.getElementById(this.id).innerHTML=txtHTML;
}
function clearAll () {
var idMenu="";
for (var i=1;i<5;i++) {
idMenu=genericID+i;
if (document.getElementById(idMenu)) {
document.getElementById(idMenu).style.display='none';
}
}
}
var genericID="menu";
var rubriqueSoin=new Array ("Gamme Ultimate","soins.php","Gamme Integral","soins.php?idGamme=2","Gamme Optimal","soins.php?idGamme=3");
var rubriqueAbout=new Array ("Philosophie","#","Recherche & Innovation","#","Carriere","#","Contact","#");
var rubriqueDiagnostic=new Array ("La dermo-cosmétique","#","Diagnostic Peau","#","Diagnostic Solaire","#","Actualités","#");
var menuSoin= new menuDeroulant (1,0,40,'soins.php',rubriqueSoin);
var menuAbout= new menuDeroulant (2,160,40,'diag.php',rubriqueAbout);
var menuDiagnostic= new menuDeroulant (3,230,40,'about.php',rubriqueDiagnostic);
menuSoin.printCadre();
menuAbout.printCadre();
menuDiagnostic.printCadre();
</script>
</head>
<body onClick="javascript:clearAll();">
<a onMouseOver="javascript:menuSoin.printMenu();">Soins</a>
<a onMouseOver="javascript:menuAbout.printMenu();">About</a>
<a onMouseOver="javascript:menuDiagnostic.printMenu();">Diagnostic</a>
</body> |
Partager