Forum de discussion
Forum « Programmation Javascript » (archives)
Je n'arrive pas à "activer" les liens de mon menu !
Envoyé: 1er avril 2004, 18h11 par lazycoconut
En voilà un joli menu, seulement je voudrais pouvoir accéder aux autres pages en cliquant dessus! (sauf une case, qui déroule un sous menu). Quand je touche à /* LISTE DES LIENS */ pour mettre qqch comme '<A HREF="#" CLASS=style_lien>Luchon</B></A>'; ça me fout tout en l'air :(
Si une âme charitable consent à me renseigner à ce sujet... merci m'sieurs dames !
<!--------DEBUT Script Menu--------->
<SCRIPT language=JavaScript>
/* POSITION DU MENU */
posYmenu = 00;
posXmenu = 01;
/* DESCRIPTION DES STYLES */
document.write('<style type="text/css">');
document.write('.poppervert { POSITION:absolute; VISIBILITY:hidden; z-index:3; }')
document.write('#topgauche { POSITION:absolute; top:'+posYmenu+'px; left:'+posXmenu+'px; z-index:10; }')
document.write('A:hover.style_lien {color:#00CCFF; text-decoration:none;}') /* TEXTE SURVOLE */
document.write('A.style_lien {color:#99CCFF; text-decoration:none;}') /* TEXTE NORMAL */
document.write('</style>')
/* ECRITURE DES LIENS */
document.write('<DIV class=poppervert id=topdeckvert></DIV>');
/* LISTE DES LIENS */
zlien = new Array;
zlien[0] = new Array;
zlien[1] = new Array;
zlien[2] = new Array;
zlien[3] = new Array;
zlien[4] = new Array;
zlien[5] = new Array;
zlien[6] = new Array;
zlien[7] = new Array;
zlien[8] = new Array;
zlien[9] = new Array;
zlien[10] = new Array;
zlien[11] = new Array;
zlien[12] = new Array;
zlien[7][0] = '<A HREF="#" CLASS=style_lien>Luchon</B></A>';
zlien[7][1] = '<A HREF="#" CLASS=style_lien>Méribel</A>';
zlien[7][2] = '<A HREF="#" CLASS=style_lien>Colmar</A>';
zlien[7][3] = '<A HREF="#" CLASS=style_lien>Monte-Carlo</A>';
/* COMMENTAIRES */
var nava = (document.layers);
var dom = (document.getElementById);
var iex = (document.all);
if (nava) { sknvert = document.topdeckvert }
else if (dom) { sknvert = document.getElementById("topdeckvert").style }
else if (iex) { sknvert = topdeckvert.style }
/* COMMENTAIRES */
function pop(msg,pos)
{
sknvert.visibility = "hidden";
sknvert.top = posYmenu+pos;
sknvert.left = posXmenu+139; /* POSITION CASES SECONDAIRES */
a=true
/* BORDS DES CASES LIENS */
var content ="<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=#333366 WIDTH=108><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=1>";
pass = 0
while (pass < msg.length)
{
content += "<TR><TD BGCOLOR="+bg_i+" onMouseOver=\"this.style.background='"+bg_a+"'\" onMouseOut=\"this.style.background='"+bg_i+"'\" HEIGHT=36><FONT SIZE=2 FACE=\"Verdana\"><B> "+msg[pass]+"</B></FONT></TD></TR>";
pass++;
}
content += "</TABLE></TD></TR></TABLE>";
if (nava)
{
sknvert.document.write(content);
sknvert.document.close();
sknvert.visibility = "visible";
}
else if (dom)
{
document.getElementById("topdeckvert").innerHTML = content;
sknvert.visibility = "visible";
}
else if (iex)
{
document.all("topdeckvert").innerHTML = content;
sknvert.visibility = "visible";
}
}
/* COMMENTAIRES */
function kill()
{
sknvert.visibility = "hidden";
}
/* COMMENTAIRES */
document.onclick = kill;
/* OUVERTURE DU TABLEAU DES CASES 1 */
document.write('<DIV ID=topgauche><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 bg=#FFFFFF WIDTH=140><TR><TD><TABLE CELLPADING=0 CELLSPACING=1 BORDER=0 WIDTH=100% HEIGHT=42>')
/* ECRITURE DE LA CASE 1.1 */
document.write('<TR><TD WIDTH=140 ALIGN=center BGCOLOR='+bg_i+' onMouseOver="this.style.background=\''+bg_a+'\';kill(zlien[1],43)" onMouseOut="this.style.background=\''+bg_i+'\'" HEIGHT=49><A onClick="return(false)" onMouseOver="kill(zlien[1],43)" href=# CLASS=style_lien><FONT SIZE=2 FACE="Verdana"><B>ACCUEIL</B></FONT></a></TD></TR>')
/* ECRITURE DE LA CASE 1.2 */
document.write('<TR><TD WIDTH=140 ALIGN=center BGCOLOR='+bg_i+' onMouseOver="this.style.background=\''+bg_a+'\';" onMouseOut="this.style.background=\''+bg_i+'\'" HEIGHT=50><A onClick="return(false)" onMouseOver="pop(zlien[1],43)" href=# CLASS=style_lien><FONT SIZE=2 FACE="Verdana"><B>AGENCE ARTISTIQUE</B></FONT></a></TD></TR>')
/* ECRITURE DE LA CASE 1.3 */
document.write('<TR><TD WIDTH=140 ALIGN=center BGCOLOR='+bg_i+' onMouseOver="this.style.background=\''+bg_a+'\';" onMouseOut="this.style.background=\''+bg_i+'\'" HEIGHT=49><A onClick="return(false)" onMouseOver="pop(zlien[2],86)" href=# CLASS=style_lien><FONT SIZE=2 FACE="Verdana"><B>COMEDIENS</B></FONT></a></TD></TR>')
/* ECRITURE DE LA CASE 1.4 */
document.write('<TR><TD WIDTH=140 ALIGN=center BGCOLOR='+bg_i+' onMouseOver="this.style.background=\''+bg_a+'\';" onMouseOut="this.style.background=\''+bg_i+'\'" HEIGHT=49><A onClick="return(false)" onMouseOver="pop(zlien[3],129)" href=# CLASS=style_lien><FONT SIZE=2 FACE="Verdana"><B>AUTEURS</B></FONT></a></TD></TR>')
/* ECRITURE DE LA CASE 1.5 */
document.write('<TR><TD WIDTH=140 ALIGN=center BGCOLOR='+bg_i+' onMouseOver="this.style.background=\''+bg_a+'\';" onMouseOut="this.style.background=\''+bg_i+'\'" HEIGHT=49><A onClick="return(false)" onMouseOver="pop(zlien[4],172)" href=# CLASS=style_lien><FONT SIZE=2 FACE="Verdana"><B>BUDGETS</B></FONT></a></TD></TR>')
/* ECRITURE DE LA CASE 1.6 */
document.write('<TR><TD WIDTH=140 ALIGN=center BGCOLOR='+bg_i+' onMouseOver="this.style.background=\''+bg_a+'\';" onMouseOut="this.style.background=\''+bg_i+'\'" HEIGHT=49><A onClick="return(false)" onMouseOver="pop(zlien[5],215)" href=# CLASS=style_lien><FONT SIZE=2 FACE="Verdana"><B>COMPOSITEURS</B></FONT></a></TD></TR>')
/* ECRITURE DE LA CASE 1.7 */
document.write('<TR><TD WIDTH=140 ALIGN=center BGCOLOR='+bg_i+' onMouseOver="this.style.background=\''+bg_a+'\';" onMouseOut="this.style.background=\''+bg_i+'\'" HEIGHT=49><A onClick="return(false)" onMouseOver="pop(zlien[6],258)" href=# CLASS=style_lien><FONT SIZE=2 FACE="Verdana"><B>EVENEMENTIEL</B></FONT></a></TD></TR>')
/* ECRITURE DE LA CASE 1.8 */
document.write('<TR><TD WIDTH=140 ALIGN=center BGCOLOR='+bg_i+' onMouseOver="this.style.background=\''+bg_a+'\';pop(zlien[7],351)" onMouseOut="this.style.background=\''+bg_i+'\'" HEIGHT=49><A onClick="return(false)" onMouseOver="pop(zlien[7],351)" href=# CLASS=style_lien><FONT SIZE=2 FACE="Verdana"><B>FESTIVALS</B></FONT></a></TD></TR>')
/* ECRITURE DE LA CASE 1.9 */
document.write('<TR><TD WIDTH=140 ALIGN=center BGCOLOR='+bg_i+' onMouseOver="this.style.background=\''+bg_a+'\';" onMouseOut="this.style.background=\''+bg_i+'\'" HEIGHT=49><A onClick="return(false)" onMouseOver="pop(zlien[8],344)" href=# CLASS=style_lien><FONT SIZE=2 FACE="Verdana"><B>LONG METRAGES</B></FONT></a></TD></TR>')
/* ECRITURE DE LA CASE 1.10 */
document.write('<TR><TD WIDTH=140 ALIGN=center BGCOLOR='+bg_i+' onMouseOver="this.style.background=\''+bg_a+'\';" onMouseOut="this.style.background=\''+bg_i+'\'" HEIGHT=49><A onClick="return(false)" onMouseOver="pop(zlien[9],387)" href=# CLASS=style_lien><FONT SIZE=2 FACE="Verdana"><B>REALISATEURS</B></FONT></a></TD></TR>')
/* ECRITURE DE LA CASE 1.11 */
document.write('<TR><TD WIDTH=140 ALIGN=center BGCOLOR='+bg_i+' onMouseOver="this.style.background=\''+bg_a+'\';" onMouseOut="this.style.background=\''+bg_i+'\'" HEIGHT=50><A onClick="return(false)" onMouseOver="pop(zlien[10],430)" href=# CLASS=style_lien><FONT SIZE=2 FACE="Verdana"><B>STYLISTES DECORATEURS</B></FONT></a></TD></TR>')
/* ECRITURE DE LA CASE 1.12 */
document.write('<TR><TD WIDTH=140 ALIGN=center BGCOLOR='+bg_i+' onMouseOver="this.style.background=\''+bg_a+'\';" onMouseOut="this.style.background=\''+bg_i+'\'" HEIGHT=50><A onClick="return(false)" onMouseOver="pop(zlien[11],473)" href=# CLASS=style_lien><FONT SIZE=2 FACE="Verdana"><B>TELEFILMS</B></FONT></a></TD></TR>')
/* FERMETURE DU TABLEAU DES CASES 1 */
document.write('</TABLE></TD></TR></TABLE></DIV>')
</SCRIPT>
<!-----------FIN Menu------------------>
Réponses
|