Bonjour,
J'ai commencé à bricoler une barre de progression, mais maintenant je voudrais y intégrer le pourcentage d'avancement et je cale. Quelqu'un aurait-il une idée ?
D'avance merci.

http://huskyland.chez-alice.fr/crbst_110.html

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
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
	#Cadre{
	position:absolute;
	left:6px;
	top:46px;
	width:500px;
	height:50px;
	border:5px navy solid;
	background-color:#ffffff;
	}
	#Progress{
	position:absolute;
	left:10px;
	top:50px;
	width:0px;
	height:50px;
	background-color:#999999;
	border-left:1px navy solid;
	border-bottom:1px navy solid;
	border-top:1px navy solid;
	}
</style>
 
<script type="text/javascript">
 
var incremProgress = 5;
var progressWith=0;
var urlRedirect = "http://huskyland.chez-alice.fr/";
 
function startProgress()
{
	progressWith = progressWith + incremProgress;
	if( progressWith  < 500)
		document.getElementById("Progress").style.width = progressWith + "px";
	else
	{
		document.getElementById("Progress").style.width = "500px";
		window.location = urlRedirect;
	}
}
 
setInterval("startProgress()",50);
</script>
 
<title>Progress Barre</title>
 
</head>
 
<body>
 
<script type="text/javascript">
document.write("Vous allez être redirigé dans un instant vers cette url : " + urlRedirect)
</script>
 
	<div id="Cadre"></div>
	<div id="Progress" ></div>
 
</body>
</html>