IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JavaScript Discussion :

Menu Horizontal demande d'informations


Sujet :

JavaScript

  1. #1
    Membre habitué Avatar de M1000
    Homme Profil pro
    Chef de projet NTIC
    Inscrit en
    Novembre 2003
    Messages
    201
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Chef de projet NTIC
    Secteur : Santé

    Informations forums :
    Inscription : Novembre 2003
    Messages : 201
    Points : 186
    Points
    186
    Par défaut Menu Horizontal demande d'informations
    Bonjour,

    Voici le code de mon menu déroulant horizontal:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
     
    hauteurcadre = 15;
    bgColorCadre = '#993355'
     
    xmenu = new Array;
    xlien = new Array;
     
    xmenu[0] = '<img src="design/m1.gif" border="0">';
    xmenu[1] = '<img src="design/m2.gif" border="0">';
    xmenu[2] = '<img src="design/m3.gif" border="0">';
    xmenu[3] = '<img src="design/m4.gif" border="0">';
    xmenu[4] = '<img src="design/m5.gif" border="0">';
     
     
    xlien[0] = ''
    xlien[1] = ''
    xlien[2] = ''
    xlien[3] = ''
    xlien[4] = ''
    xlien[0] += '<A HREF="texte1.htm" CLASS=menudyn3>texte1</A>';
    xlien[1] += '<A HREF="texte1.htm" CLASS=menudyn3>texte1</A>';
    xlien[2] += '<A HREF="texte1.htm" CLASS=menudyn3>texte1</A>';
    xlien[3] += '<A HREF="texte1.htm" CLASS=menudyn3>texte1</A>';
    xlien[4] += '<A HREF="texte1.htm" CLASS=menudyn3>texte1</A>';
    xlien[1] += ' | '
    xlien[1] += '<A HREF="texte2.htm" CLASS=menudyn3>texte2</A>';
    xlien[2] += ' | '
    xlien[2] += '<A HREF="texte2.htm" CLASS=menudyn3>texte2</A>';
    xlien[3] += ' | '
    xlien[3] += '<A HREF="texte2.htm" CLASS=menudyn3>texte2</A>';
    xlien[3] += ' | '
    xlien[3] += '<A HREF="" CLASS=menudyn3>sdfdhgjk</A>';
    xlien[4] += ' | '
    xlien[4] += '<A HREF="texte2.htm" CLASS=menudyn3>texte2</A>';
    xlien[4] += ' | '
    xlien[4] += '<A HREF="texte3.htm" CLASS=menudyn3>texte3</A>';
    xlien[3] += ' | '
    xlien[3] += '<A HREF="texte3.htm" CLASS=menudyn3>texte3</A>';
    xlien[3] += ' | '
    xlien[3] += '<A HREF="texte4.htm" CLASS=menudyn3>texte3</A>';
    xlien[0] += ' | '
    xlien[0] += '<A HREF="texte2.htm" CLASS=menudyn3>texte2</A>';
    xlien[0] += ' | '
    xlien[0] += '<A HREF="texté3.htm" CLASS=menudyn3>texté3</A>';
     
    document.write('<STYLE TYPE="text/css">\nA.menudyn3 {color:#FFFFFF; text-decoration:none;}\nA:hover.menudyn3 {color:#33CC00;text-decoration:none;}\n</STYLE>');
     
    document.write('<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH='+(xlien.length*100)+' BGCOLOR=#000000>  <TR><TD><TABLE CELLPADDING=0 CELLSPACING=1px BORDER=0 WIDTH=100%>  <TR>');
     
    for(i=0;i<xlien.length;i++)
     
    {
    	document.write('<TD BGCOLOR=#993300 onMouseOver="javascript:colorIt(this);MajMenu('+i+');" ALIGN=center ID=td'+i+'><FONT SIZE=1 FACE="Verdana"><B><A HREF="#" onClick="return(false)" onMouseOver="MajMenu('+i+')" CLASS=menudyn3>'+xmenu[i]+'</A></B></FONT></TD>');
    	}
     
    document.write('</TR>  <TR>    <TD COLSPAN='+(xlien.length)+' BGCOLOR='+bgColorCadre+' HEIGHT='+hauteurcadre+' VALIGN=top><ilayer id="dynamenu31" width=100% height='+hauteurcadre+'><layer id="dynamenu32" width=100% height='+hauteurcadre+'><div id="dynamenu33">&nbsp;</div></layer></ilayer></TD>  </TR></TABLE></TD></TR></TABLE>');
     
    function colorIt(tditem)
    	{
    	if(document.all)
    		{
    	document.all.td0.style.background='#993300';
    	document.all.td1.style.background='#993300';
    	document.all.td2.style.background='#993300';
    	document.all.td3.style.background='#993300';
    	document.all.td4.style.background='#993300';
    		tditem.style.background='#FFCC00';
    		}
    else if(document.getElementById)
    	{
    	document.getElementById("td0").style.background='#993300';
    	document.getElementById("td1").style.background='#993300';
    	document.getElementById("td2").style.background='#993300';
    	document.getElementById("td3").style.background='#993300';
    	document.getElementById("td4").style.background='#993300';
    tditem.style.background='#FFCC00';
    	}
    }
     
    function MajMenu(menu)
    	{
    	which = xlien[menu];
     
    if (document.layers)
    	{
    	document.dynamenu31.document.dynamenu32.document.write('<FONT SIZE=1 FACE="Verdana"><B>'+which+'</B></FONT>')
    	document.dynamenu31.document.dynamenu32.document.close()
    	}
    else if (document.getElementById)
    			{
    			document.getElementById("dynamenu33").innerHTML = '<CENTER><FONT SIZE=1 FACE="Verdana, Arial"><B>'+which+'</B></FONT>		</CENTER>';
    			}
    else 	if (document.all)
    		{
    			dynamenu33.innerHTML='&nbsp;'
    			dynamenu33.innerHTML='<FONT SIZE=1 FACE="Verdana"><B>'+which+'</B></FONT>';
    		}
    }
    if (document.getElementById)
    	colorIt(document.getElementById("td0"));
    else if (document.all)
    	{
    		colorIt(document.all.td0);
    	}
    MajMenu(0);
    Ma question est la suivante comment faire pour que la couleur de fond de la ligne sous le menu général change de couleur en fonction du menu, c'est cette variable qui doit changer: bgColorCadre. mais je ne vois pas ou et comment faire le test pour changer la couleur.

    Merci @très bientot.

  2. #2
    Membre habitué Avatar de M1000
    Homme Profil pro
    Chef de projet NTIC
    Inscrit en
    Novembre 2003
    Messages
    201
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Chef de projet NTIC
    Secteur : Santé

    Informations forums :
    Inscription : Novembre 2003
    Messages : 201
    Points : 186
    Points
    186
    Par défaut
    j'ai essayé tte la nuit et encore ce matin et je comprend pas comment faire changer la couleur a chaque sous menu en fonction du menu principal ....

    Help Me

    Merci

Discussions similaires

  1. demande d'information sur un menu
    Par ferhat.adel dans le forum Mise en page CSS
    Réponses: 2
    Dernier message: 28/02/2011, 17h40
  2. [ATL - ActiveX] demande d informations
    Par venomelektro dans le forum MFC
    Réponses: 7
    Dernier message: 22/03/2005, 20h09
  3. prob menu horizontal
    Par tinkye_winkye dans le forum Mise en page CSS
    Réponses: 3
    Dernier message: 25/01/2005, 11h19
  4. Réponses: 3
    Dernier message: 01/02/2004, 21h24

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo