Aide javascript
azerty1234
Messages postés
12
Statut
Membre
-
azerty1234 Messages postés 12 Statut Membre -
azerty1234 Messages postés 12 Statut Membre -
Bonjour
Je suis debutante en javascript. J'ai un probleme.
J'aimerai que quand on clique sur image1 cela affiche le tableau1 puis quand on clique sur image2 cela affiche le tableau2 au meme endroit donc en fait quand on clique sur image2 le tableau1 est invisible.
Je pense qu il faut faire ca en javascript. En fait j'ai deja reussi a faire par l'evenement onclick pour cliquer un evenement. Mais le probleme c'est la suite.
Désole si c'est pas tres claire.Merci.
P.S : j'utilise notepad++ et firefox
Je suis debutante en javascript. J'ai un probleme.
J'aimerai que quand on clique sur image1 cela affiche le tableau1 puis quand on clique sur image2 cela affiche le tableau2 au meme endroit donc en fait quand on clique sur image2 le tableau1 est invisible.
Je pense qu il faut faire ca en javascript. En fait j'ai deja reussi a faire par l'evenement onclick pour cliquer un evenement. Mais le probleme c'est la suite.
Désole si c'est pas tres claire.Merci.
P.S : j'utilise notepad++ et firefox
A voir également:
- Aide javascript
- Telecharger javascript - Télécharger - Langages
- A javascript error occurred in the main process - Forum Handicap / Accessibilté
- Afficher un tableau javascript en html ✓ - Forum Javascript
- Javascript arrondi - Forum Javascript
- Javascript arrondi après la virgule ✓ - Forum Windows
2 réponses
avaec dreamweaver, ça peut donner :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Document sans nom</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</script>
</head>
<body>
<table width="737">
<tr>
<td width="727"><img src="image1.gif" width="65" height="58" onClick="MM_showHideLayers('Layer1','','show');MM_showHideLayers('Layer2','','hide')"></td>
</tr>
<tr>
<td><img src="image2.gif" width="64" height="64" onClick="MM_showHideLayers('Layer2','','show');MM_showHideLayers('Layer1','','hide')"></td>
</tr>
</table>
<div id="Layer1" style="position:absolute; width:200px; height:87px; z-index:1; left: 261px; top: 17px; visibility: hidden;">
<table width="200" border="1" bgcolor="#FF0000">
<tr>
<td width="46">tableau</td>
<td width="66">1</td>
<td width="66"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
<div id="Layer2" style="position:absolute; width:200px; height:95px; z-index:2; left: 262px; top: 15px; visibility: hidden;">
<table width="200" border="1" bgcolor="#0000FF">
<tr>
<td width="63">tableau</td>
<td width="59">2</td>
<td width="56"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Document sans nom</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</script>
</head>
<body>
<table width="737">
<tr>
<td width="727"><img src="image1.gif" width="65" height="58" onClick="MM_showHideLayers('Layer1','','show');MM_showHideLayers('Layer2','','hide')"></td>
</tr>
<tr>
<td><img src="image2.gif" width="64" height="64" onClick="MM_showHideLayers('Layer2','','show');MM_showHideLayers('Layer1','','hide')"></td>
</tr>
</table>
<div id="Layer1" style="position:absolute; width:200px; height:87px; z-index:1; left: 261px; top: 17px; visibility: hidden;">
<table width="200" border="1" bgcolor="#FF0000">
<tr>
<td width="46">tableau</td>
<td width="66">1</td>
<td width="66"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
<div id="Layer2" style="position:absolute; width:200px; height:95px; z-index:2; left: 262px; top: 15px; visibility: hidden;">
<table width="200" border="1" bgcolor="#0000FF">
<tr>
<td width="63">tableau</td>
<td width="59">2</td>
<td width="56"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</body>
</html>