bonjour a tous,
j'ai un problème avec un javascript de menu dynamique
les menus sont censés se rétractés lorsqu'on clique autre part que sur un lien de ce menu, mais j'aimerai bien que juste passer la souris en dehors du menu le fasse se rétracter
voici le lien de mon projet de site avec ce menu (compatible IE pour l'instant seulement, chuis dsl, chuis un fana de
FF :D )
http://lotrbfme.free.fr/test
je pense qu'il vous faudra le code du script^^
voici le premier menu (bfme):
bgcolor='#dce0d2';
bgcolor2='#dce0d2';
document.write('<style type="text/css">');
document.write('.popper { POSITION: absolute; VISIBILITY: hidden; z-index:15; left:99px ')
document.write('#topgauche { position:absolute; z-index:10; }')
document.write('A:hover.ejsmenu {color:#000000; text-decoration:none; font-weight: bold;}')
document.write('.ejsmenu {color:#000000; text-decoration:none;}')
document.write('</style>')
document.write('<div style="position:relative;height:25"><DIV class=popper id=topdeck></DIV>');
/*
LIENS
*/
zlien = new Array;
zlien[0] = new Array;
zlien[1] = new Array;
zlien[2] = new Array;
zlien[3] = new Array;
zlien[0][0] = '<A HREF="#" CLASS=ejsmenu>Présentation</A>';
zlien[0][1] = '<A HREF="#" CLASS=ejsmenu>Test</A>';
zlien[0][2] = '<A HREF="#" CLASS=ejsmenu>Config minimum</A>';
zlien[0][3] = '<A HREF="#" CLASS=ejsmenu>Galerie d image</A>';
zlien[1][0] = '<A HREF="#" CLASS=ejsmenu>Gondor</A>';
zlien[1][1] = '<A HREF="#" CLASS=ejsmenu>Rohan</A>';
zlien[1][2] = '<A HREF="#" CLASS=ejsmenu>Isengard</A>';
zlien[1][3] = '<A HREF="#" CLASS=ejsmenu>Mordor</A>';
zlien[2][0] = '<A HREF="#" CLASS=ejsmenu>Maps</A>';
zlien[2][1] = '<A HREF="#" CLASS=ejsmenu>Mods</A>';
zlien[2][2] = '<A HREF="#" CLASS=ejsmenu>Patchs</A>';
zlien[2][3] = '<A HREF="#" CLASS=ejsmenu>Replays</A>';
zlien[2][4] = '<A HREF="#" CLASS=ejsmenu>Vidéos</A>';
zlien[2][5] = '<A HREF="#" CLASS=ejsmenu>Divers</A>';
zlien[3][0] = '<A HREF="#" CLASS=ejsmenu>Liste des teams fr</A>';
zlien[3][1] = '<A HREF="#" CLASS=ejsmenu>Tournois</A>';
zlien[3][2] = '<A HREF="http://www.clanwars.cc" target="_blank" CLASS=ejsmenu>Clanwars.cc</A>';
zlien[3][3] = '<A HREF="http://arena.gamespy.com/bfme" target="_blank" CLASS=ejsmenu>Ladders officiels</A>';
zlien[3][4] = '<A HREF="#" CLASS=ejsmenu>Stratégies</A>';
if(document.getElementById)
{
skn = document.getElementById("topdeck").style
skn.left = 99;
}
function pop(msg,pos)
{
skn.visibility = "hidden";
a=true
skn.top = pos;
var content ="<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=#000000 WIDTH=150><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=1>";
pass = 0
while (pass < msg.length)
{
content += "<TR><TD BGCOLOR="+bgcolor+" onMouseOver=\"this.style.background='"+bgcolor2+"'\" onMouseOut=\"this.style.background='"+bgcolor+"'\" HEIGHT=20><FONT SIZE=1 FACE=\"Verdana\"> "+msg[pass]+"</FONT></TD></TR>";
pass++;
}
content += "</TABLE></TD></TR></TABLE>";
document.getElementById("topdeck").innerHTML = content;
skn.visibility = "visible";
}
function kill()
{
if(document.getElementById) {
skn.visibility = "hidden";
}
}
document.onclick = kill;
if(document.getElementById)
{
document.write('<DIV ID=topgauche><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=#000000 WIDTH=100 HEIGHT=60><TR><TD><TABLE CELLPADING=0 CELLSPACING=1 BORDER=0 WIDTH=100% HEIGHT=80>')
document.write('<tr><TD WIDTH=100 ALIGN=center BGCOLOR='+bgcolor+' onMouseOver="this.style.background=\\\''+bgcolor2+'\\\';pop(zlien[0],0)" onMouseOut="this.style.background=\\\''+bgcolor+'\\\'" CLASS=ejsmenu><FONT SIZE=1 FACE="Verdana">Généralites</FONT></TD></tr>')
document.write('<tr><TD WIDTH=100 ALIGN=center BGCOLOR='+bgcolor+' onMouseOver="this.style.background=\\\''+bgcolor2+'\\\';pop(zlien[1],20)" onMouseOut="this.style.background=\\\''+bgcolor+'\\\'" CLASS=ejsmenu><FONT SIZE=1 FACE="Verdana">Races</FONT></TD></tr>')
document.write('<tr><TD WIDTH=100 ALIGN=center BGCOLOR='+bgcolor+' onMouseOver="this.style.background=\\\''+bgcolor2+'\\\';pop(zlien[2],40)" onMouseOut="this.style.background=\\\''+bgcolor+'\\\'" CLASS=ejsmenu><FONT SIZE=1 FACE="Verdana">Téléchargements</FONT></TD></tr>')
document.write('<tr><TD WIDTH=100 ALIGN=center BGCOLOR='+bgcolor+' onMouseOver="this.style.background=\\\''+bgcolor2+'\\\';pop(zlien[3],60)" onMouseOut="this.style.background=\\\''+bgcolor+'\\\'" CLASS=ejsmenu><FONT SIZE=1 FACE="Verdana">Multijoueur</FONT></TD></tr>')
document.write('</TABLE></TD></TR></TABLE></DIV>')
}
document.write('</div>');
voici le deuxieme (rtw):
bgcolor='#dce0d2';
bgcolor2='#dce0d2';
document.write('<style type="text/css">');
document.write('.popper { POSITION: absolute; VISIBILITY: hidden; z-index:15; left:99px ')
document.write('#topgauche2 { position:absolute; z-index:10; }')
document.write('A:hover.ejsmenu {color:#000000; text-decoration:none; font-weight: bold;}')
document.write('.ejsmenu {color:#000000; text-decoration:none;}')
document.write('</style>')
document.write('<div style="position:relative;height:25"><DIV class=popper id=topdeck2></DIV>');
/*
LIENS
*/
zlien2 = new Array;
zlien2[0] = new Array;
zlien2[1] = new Array;
zlien2[2] = new Array;
zlien2[0][0] = '<A HREF="#" CLASS=ejsmenu>Présentation</A>';
zlien2[0][1] = '<A HREF="#" CLASS=ejsmenu>Test</A>';
zlien2[0][2] = '<A HREF="#" CLASS=ejsmenu>Config minimum</A>';
zlien2[0][3] = '<A HREF="#" CLASS=ejsmenu>Galerie d images</A>';
zlien2[0][4] = '<A HREF="#" CLASS=ejsmenu>Factions</A>';
zlien2[1][0] = '<A HREF="#" CLASS=ejsmenu>Mods</A>';
zlien2[1][1] = '<A HREF="#" CLASS=ejsmenu>Patchs</A>';
zlien2[1][2] = '<A HREF="#" CLASS=ejsmenu>Vidéos</A>';
zlien2[1][3] = '<A HREF="#" CLASS=ejsmenu>etc...</A>';
zlien2[2][0] = '<A HREF="#" CLASS=ejsmenu>Liste des teams fr</A>';
zlien2[2][1] = '<A HREF="#" CLASS=ejsmenu>Ladders officiels ?</A>';
zlien2[2][2] = '<A HREF="#" CLASS=ejsmenu>Tournois</A>';
if(document.getElementById)
{
skn2 = document.getElementById("topdeck2").style
skn2.left = 99;
}
function pop2(msg,pos)
{
skn2.visibility = "hidden";
a=true
skn2.top = pos;
var content ="<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=#000000 WIDTH=150><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=1>";
pass = 0
while (pass < msg.length)
{
content += "<TR><TD BGCOLOR="+bgcolor+" onMouseOver=\"this.style.background='"+bgcolor2+"'\" onMouseOut=\"this.style.background='"+bgcolor+"'\" HEIGHT=20><FONT SIZE=1 FACE=\"Verdana\"> "+msg[pass]+"</FONT></TD></TR>";
pass++;
}
content += "</TABLE></TD></TR></TABLE>";
document.getElementById("topdeck2").innerHTML = content;
skn2.visibility = "visible";
}
function kill()
{
if(document.getElementById) {
skn2.visibility = "hidden";
}
}
document.onclick = kill;
if(document.getElementById)
{
document.write('<DIV ID=topgauche2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=#000000 WIDTH=100 HEIGHT=60><TR><TD><TABLE CELLPADING=0 CELLSPACING=1 BORDER=0 WIDTH=100% HEIGHT=60>')
document.write('<tr><TD WIDTH=100 ALIGN=center BGCOLOR='+bgcolor+' onMouseOver="this.style.background=\\''+bgcolor2+'\\';pop2(zlien2[0],0)" onMouseOut="this.style.background=\\''+bgcolor+'\\'" CLASS=ejsmenu><FONT SIZE=1 FACE="Verdana">Généralites</FONT></TD></tr>')
document.write('<tr><TD WIDTH=100 ALIGN=center BGCOLOR='+bgcolor+' onMouseOver="this.style.background=\\''+bgcolor2+'\\';pop2(zlien2[1],20)" onMouseOut="this.style.background=\\''+bgcolor+'\\'" CLASS=ejsmenu><FONT SIZE=1 FACE="Verdana">Téléchargements</FONT></TD></tr>')
document.write('<tr><TD WIDTH=100 ALIGN=center BGCOLOR='+bgcolor+' onMouseOver="this.style.background=\\''+bgcolor2+'\\';pop2(zlien2[2],40)" onMouseOut="this.style.background=\\''+bgcolor+'\\'" CLASS=ejsmenu><FONT SIZE=1 FACE="Verdana">Multijoueur</FONT></TD></tr>')
document.write('</TABLE></TD></TR></TABLE></DIV>')
}
document.write('</div>');
si au passage vous pouviez me dire d'ou vient le pb de compatibilité sous
FF je serai comblé lol
merci d'avance pour vos réponses !!
a+
tibo