Bonjour à tous,

J'ai un petit problème avec un script que je ne parviens pas à placer ou je le souhaite dans mes pages html.

En effet, il s'agit d'une fonction "body onload", et je ne connais pas son fonctionnement.

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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<html>
<head>
 
 
 
 
 
 
 
 
  <title>exemple4</title>
  <script language="Javascript">
var sem=new Array(7);
var a=0,b=0;
sem[1]="Monday";
sem[2]="Tuesday";
sem[3]="Wednesday";
sem[4]="Thursday";
sem[5]="Friday";
sem[6]="Saturday";
sem[0]="Sunday";
var _12mois=new Array(12);
_12mois[0]="January";
_12mois[1]="February";
_12mois[2]="March";
_12mois[3]="April";
_12mois[4]="May";
_12mois[5]="June";
_12mois[6]="July";
_12mois[7]="August";
_12mois[8]="September";
_12mois[9]="October";
_12mois[10]="November";
_12mois[11]="Décember";
var date=new Date(); //déclaration d'une variable de type date qui contient la date courante
var mois=date.getMonth(); //la variable mois contient le N° du mois de 0 à 11
var jour=date.getDate();
var annee=date.getFullYear();
var jour_sem=date.getDay();
document.write(("On "+sem[jour_sem]+", "+_12mois[mois]+" "+jour+", "+annee+"... MY SPECIAL RISK-FREE OFFER* WILL EXPIRE ! <br>").bold().fontcolor("red").fontsize("5").italics());
function aff() {
var horl = new Date();
var heure=horl.getHours(); min=horl.getMinutes(); sec=horl.getSeconds();
document.form1.texte.value=heure+"h "+(min<10?"0":"")+min+"m "+(sec<10?"0":"")+sec+"s";
document.getElementById("he").innerHTML="- 0 day(s) "+(23-heure)+" hour(s) "+(min>50?"0":"")+(59-min)+" minute(s) "+(sec>=50?"0":"")+(59-sec)+" second(s)";
//val();
document.getElementById("he").style.left = document.body.scrollLeft + a;
document.getElementById("he").style.top = document.body.scrollTop + b;
setTimeout('aff()',10);
}
  </script>
</head>
 
 
<body onLoad="aff()" style="background-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" alink="#ee0000" link="#0000ee" vlink="#551a8b">
 
 
 
<div style="text-align: center;"><font><span style="color: rgb(255, 0, 0);"><big><span style="font-weight: bold;"><br>
 
 
 
</span><small>* During my special time-limited offer, you
will get all my products for only $14.99 instead of $584.99</small></big><br>
 
 
 
</span></font></div>
 
 
 
<div style="text-align: center;"><font><span style="font-weight: bold; color: rgb(255, 0, 0);"></span></font>
<form style="height: 21px; background-color: rgb(0, 0, 0);" name="form1"> <input style="font-family: tahoma,verdana; color: red; font-size: 8pt;" name="texte" value="Display hour" onClick="if (document.form1.texte.value='Display hour') aff()" type="hidden">
  <big style="color: rgb(255, 0, 0);"><span style="font-weight: bold;">Counting down to the end of the
special offer :</span></big><br style="color: rgb(255, 0, 0);">
 
 
 
<big style="color: rgb(255, 0, 0);"><span style="font-weight: bold;">
</span></big>
</form>
 
 
 
</div>
 
 
 
<div style="text-align: center;"></div>
 
 
 
<div id="he" style="font-family: tahoma,verdana; font-size: 18pt; font-weight: bold; background-color: rgb(0, 0, 0); color: rgb(255, 0, 0); text-align: center;"><br>
 
 
 
</div>
 
 
 
<div style="text-align: center;"></div>
 
 
 
<div style="color: rgb(255, 0, 0); text-align: center;"></div>
 
 
 
<div style="text-align: center;"><span style="color: rgb(255, 0, 0);"><br>
 
 
 
After my special offer expires, you will still be able to buy the bonus
package separately for $199 instead of $570</span></div>
 
 
 
</body>
</html>
J'ai remarqué que la balise <body onload> remplace la balise <body>, de sorte que je ne peux pas placer mon compteur ou je veux dans mes pages, sans mettre en péril son fonctionnement.

Quelqu'un aurait-il une solution de secours afin de me permettre de placer mon compteur ou je veux sans problème ? Et comment faire pour centrer la ligne ou apparait la date (il semblerait que celle-ci se charge systématiquement en haut de page, et non dans le meme bloc que le reste du compteur).

Voici un lien ou vous pourrez voir à quoi ressemble le compteur et comment il se comporte :

http://www.letsgetyourmoneyback.com/sheriftest19.html

Merci beaucoup pour votre aide,

Thomas