2 pièce(s) jointe(s)
Afficher masquer DIV suivante sur clic image JavaScript
Bonjour
Après le clic sur l'image Pièce jointe 293924 je souhaiterai afficher l'image Pièce jointe 293929 .
J'ai fait des recherche et perdu beaucoup de temps mais j'ai pas trouver de solution.
Voici mon code :
Code:
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
| <!doctype html>
<html>
<head>
<link href="\CSS\style.css" rel="stylesheet" type="text/css"/>
<title>Afficher masquer div suivante</title>
<script type="text/javascript">
function Hide (addr) { document.getElementById(addr).style.display='none'; }
function Show (addr) { document.getElementById(addr).style.display ='block'; }
function toggle(anId)
{
if (document.getElementById(anId).style.display == "none") { Show(anId); }
else { Hide(anId); }
}
window.onload = function () { Hide("foo"); };
window.onload = function () { Hide("foo1"); };
</script>
</head>
<body>
<h2>Afficher masquer div suivante</h2>
<h6><a href="#" onclick = "toggle('foo');"><img src='/Images/kitplus.png' align="top" hspace="0" vspace="1">Cliquer pour basculer l'état du div suivant 1</a></h6>
<div id="foo">Ce contenu est visible ou non selon le cas 1 </div>
<h6><a href="#" onclick = "toggle('foo1');"><img src='/Images/kitplus.png' align="top" hspace="0" vspace="1">Cliquer pour basculer l'état du div suivant 2</a></h6>
<div id="foo1">Ce contenu est visible ou non selon le cas 2 </div>
</body>
</html> |
Comment le modifier pour arriver au résultat souhaité ?
Merci d'avance pour votre participation.