Bonjour
dans ma page en fait j'ai deux animations javascript et chacune fonctionne avec un onload et il doit y avoir conflit.Il n'y en a qu'une sur 2 qui fonctionnent.

Voici ci joint les morceaux de code:

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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Gothic</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" media="all" href="styles.css" />
<script language="JavaScript">
<!--
function objet() {
this.length = objet.arguments.length
for (var i = 0; i < this.length; i++) this[i+1] = objet.arguments[i]
}
var nom = new objet ("imaga.gif", "imagb.gif", "imagc.gif", "imagd.gif", "image.gif", "imagf.gif");
var numero = 1;
function changer() {
document.image.src = "img/"+nom[numero];
numero += 1;
if (numero == nom.length + 1) numero = 1;
setTimeout("changer()", 2000);
}
//-->
</script>
 
</head>
<body bgcolor="#FFFFFF" background="img/fond.gif" onLoad="changer()"><div id="container">
<div id="header">
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
<div id="content">
<h2>About "Gothic"</h2>
<p><img src="images/image1.jpg" class="right" width="150" height="126" alt="Bild" />
		"Gothic" is an Open Source Template released under a <a href="http://creativecommons.org/licenses/by-sa/3.0/deed.de">Creative Commons License</a>. The full CC License can be found  <a href="http://creativecommons.org/licenses/by-sa/3.0/legalcode">here</a>.
		</p>
 
			<p>
      You are free to use, copy and/or modify this template. You must not change the license to anything 'less' free. You are required to keep the link back to the author's site in the footer of the template. 
		Removal of the link is possible for a small fee.
		</p>
 
<p class="read_more"><a href="#">more ...</a></p>
<h2>Some more content</h2>
<p><img src="images/image2.jpg" class="left" width="150" height="87" alt="Bild" />Ma quande lingues coalesce, li grammatica del resultant lingue es plu simplic e regulari quam ti del coalescent lingues. Li nov lingua franca va esser plu simplic e regulari quam li existent Europan lingues. It va esser tam simplic quam Occidental: in fact, it va esser Occidental. A un Angleso it va semblar un simplificat Angles, quam un skeptic Cambridge amico dit me que Occidental es. Ma quande lingues coalesce, li grammatica del resultant lingue es plu simplic e regulari quam ti del coalescen</p>
<p class="read_more"><a href="#">more ...</a></p>
</div><!-- end content -->
<div id="right">
<h2>Conseils</h2>
<p><!-- DEBUT DU SCRIPT --><DIV ID=ejs_box2_box STYLE="background:#FFFFFF;color:#000000;font-family:Verdana;font-size:11;width:100;height:100;padding:5"></DIV>
 
 <SCRIPT LANGUAGE=JavaScript>
 /*
 SCRIPT EDITE SUR L'EDITEUR JAVASCRIPT
 */
 ejs_box2_message = new Array;
 ejs_box2_message[0] = 'Faites aérer les pièces lorsque vous peignez vous risquez de suffoquer.';
ejs_box2_message[1] = 'Protégez vous avec un masque pour ne pas abîmer vos poumons.';
ejs_box2_message[2] = 'Porter un masque de protection et des gants lorsque vous soudez.';
 
 ejs_box2_actual = 0;
 ejs_box2_html_flag = 0;
 
 function ejs_box2_go()
     {
     if(document.getElementById)
         {
         ejs_box2_char = 1;
         ejs_box2_affich(ejs_box2_actual)
         ejs_box2_actual++;
         if(ejs_box2_actual >= ejs_box2_message.length)
             ejs_box2_actual = 0;
         }        
     }
 
 function ejs_box2_affich(lactual)
     {
     var pix = ejs_box2_message[lactual].charAt(ejs_box2_char);
     if(pix == "<")
         ejs_box2_html_flag = 1;
     if(pix == ">")
         ejs_box2_html_flag = 0;
     var texte = ejs_box2_message[lactual].substring(0,ejs_box2_char);
     document.getElementById("ejs_box2_box").innerHTML = texte;
     if(ejs_box2_char < ejs_box2_message[lactual].length)
         {
         ejs_box2_char++;
         if(ejs_box2_html_flag == 1)    
             ejs_box2_affich(lactual);
         else
             setTimeout("ejs_box2_affich("+lactual+")",50)
         }
     else
         setTimeout("ejs_box2_go()",3000)
     }
 
 window.onload = ejs_box2_go;
 </SCRIPT>
 <!-- FIN DU SCRIPT --> 
</p>
 
<h2>Gallerie</h2>
<img src="img/imaga.gif" width="150" height="150" name="image" />
</div><!-- end right -->
</div><!-- end main -->
 
<div id="footer">
Y a t il un moyen pour que les 2 fonctionnent?
Merci de votre aide