Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
5038 connectés 

  FORUM HardWare.fr
  Programmation
  HTML/CSS

  Menu dynamique (problème avec visibility)

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Menu dynamique (problème avec visibility)

n°1018261
seb306bzh
Posté le 19-03-2005 à 11:36:27  profilanswer
 

Bonjour,
 
je suis entrain de faire un menu dynamique mais je n'arrive pas à afficher et cacher mes couches
 
 
voici mon code :
 
------------------------------------ menuDynamique.html ------------------------------------
 
<html>
<head>
<title>Menu dynamique vertical</title>
<link rel="stylesheet" type="text/css" href="menuDynamiqueVertical.css">
<SCRIPT Language="Javascript" Src="menuDynamiqueVertical.js"></SCRIPT>
</head>
 
<body>
<table class="tableau" border="1" align="left" width="120">
    <tr>
        <td onmouseover="this.style.backgroundColor='lightblue'; pop('chapitre1');" onmouseout="this.style.backgroundColor='#003366'; kill('chapitre1');">Chapitre1</td>
    </tr>
    <tr>
        <td onmouseover="this.style.backgroundColor='lightblue'; pop('chapitre2');" onmouseout="this.style.backgroundColor='#003366'; kill('chapitre2');">Chapitre2</td>
    </tr>
    <tr>
        <td onmouseover="this.style.backgroundColor='lightblue'; pop('chapitre3');" onmouseout="this.style.backgroundColor='#003366'; kill('chapitre3');">Chapitre3</td>
    </tr>
</table>
<table class="chapitre1" border="1" width="120">
    <tr>
        <td onmouseover="this.style.backgroundColor='lightblue';" onmouseout="this.style.backgroundColor='#003366';">section1</td>
    </tr>
    <tr>
        <td onmouseover="this.style.backgroundColor='lightblue';" onmouseout="this.style.backgroundColor='#003366';">section2</td>
    </tr>
    <tr>
        <td onmouseover="this.style.backgroundColor='lightblue';" onmouseout="this.style.backgroundColor='#003366';">section3</td>
    </tr>
</table>
<table class="chapitre2" border="1" width="120">
    <tr>
        <td onmouseover="this.style.backgroundColor='lightblue';" onmouseout="this.style.backgroundColor='#003366';">section1</td>
    </tr>
    <tr>
        <td onmouseover="this.style.backgroundColor='lightblue';" onmouseout="this.style.backgroundColor='#003366';">section2</td>
    </tr>
    <tr>
        <td onmouseover="this.style.backgroundColor='lightblue';" onmouseout="this.style.backgroundColor='#003366';">section3</td>
    </tr>
</table>
<table class="chapitre3" border="1" width="120">
    <tr>
        <td onmouseover="this.style.backgroundColor='lightblue';" onmouseout="this.style.backgroundColor='#003366';">section1</td>
    </tr>
    <tr>
        <td onmouseover="this.style.backgroundColor='lightblue';" onmouseout="this.style.backgroundColor='#003366';">section2</td>
    </tr>
    <tr>
        <td onmouseover="this.style.backgroundColor='lightblue';" onmouseout="this.style.backgroundColor='#003366';">section3</td>
    </tr>
</table>
</body>
</html>
 
------------------------------------------------------------------------------------------------------
 
// menuDynamiqueVertical.js
 
function pop(chapitre){
    //alert("pop | chapitre ="+chapitre);
    //document.getElementById("'numChapitre'" ).style.visibility="visible";
    chapitre.style.visibility='visible';
}
 
function kill(chapitre){
    chapitre.style.visibility='hidden';
}
 
-------------------------------------------------------------------------------------------------------
 
/* menuDynamiqueVertical.css */
 
.tableau {
    font-family:verdana;
    color:#FFFFFF; /*blanc*/
    background-color:#003366; /*bleu foncé*/
    text-align:center;
}
 
.chapitre1 {
    visibility:hidden;
    font-family:verdana;
    color:#FFFFFF; /*blanc*/
    background-color:#003366; /*bleu foncé*/
    text-align:center;
    position:absolute;
    left:128px;
    top:15px;
}
 
.chapitre2 {
    visibility:hidden;
    font-family:verdana;
    color:#FFFFFF; /*blanc*/
    background-color:#003366; /*bleu foncé*/
    text-align:center;
    position:absolute;
    left:128px;
    top:40px;
}
 
.chapitre3 {
    visibility:hidden;
    font-family:verdana;
    color:#FFFFFF; /*blanc*/
    background-color:#003366; /*bleu foncé*/
    text-align:center;
    position:absolute;
    left:128px;
    top:65px;
}
 
----------------------------------------------------------------------------------------------
 
est ce que vous voyez quelquechose qui ne va pas ?
 
merci d'avance  :hello:  
 

mood
Publicité
Posté le 19-03-2005 à 11:36:27  profilanswer
 

n°1018267
Hermes le ​Messager
Breton Quiétiste
Posté le 19-03-2005 à 11:45:54  profilanswer
 

exemple ? Page ? :o

n°1018280
seb306bzh
Posté le 19-03-2005 à 11:56:15  profilanswer
 


désolé
 
je les ai mises la : http://lemarechalseb.free.fr/cours/application3tiers/
 
merci


Message édité par seb306bzh le 19-03-2005 à 11:56:42
n°1018313
FlorentG
Posté le 19-03-2005 à 13:00:07  profilanswer
 

Prévois le cas où l'internaute n'a pas JS ;)
 
Sinon pour tes problèmes de menus, base-toi sur cet article chez AlsaCréations

n°1018461
masklinn
í dag viðrar vel til loftárása
Posté le 19-03-2005 à 16:50:51  profilanswer
 

A noter que l'article d'Alsa n'est franchement pas terrible au niveau de la séparation donnée/comportement [:aloy]
 
Je lui préfère largement cet article d'A List Apart qui passe par le gestionnaire d'évènements, est propre, performant et fonctionne peu ou prou parfaitement.


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
n°1021156
fnemo
Posté le 22-03-2005 à 16:11:04  profilanswer
 

style.display plutot que style.visibility ca ne serait pas mieux ?

n°1021158
fnemo
Posté le 22-03-2005 à 16:11:29  profilanswer
 

et en valeur remplace par visible par block ou inline en fonction ;)


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  HTML/CSS

  Menu dynamique (problème avec visibility)

 

Sujets relatifs
[ASP.NET] Probleme d'acces BDProblème d'interaction entre une page et une popup
Problème avec un GhostProblème avec Oracle
[C++] VFW & création d'avi ... Problème de paletteGénération dynamique de documents paramétrés (templates)
Probléme de mise en page ( ça marche sous IE mais pas sous firefox)probleme vb => excel => sub
problème avec mysql_fetch_assoc() !![résolu][applet] probleme d'affichage
Plus de sujets relatifs à : Menu dynamique (problème avec visibility)


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)