Bonjour

J'espère avoir posté au bon endroit.

Je voudrais accélérer le défilement de mon diaporama. J'ai essayé de modifier le chiffre indiqué après "speed" dans le code. Les choses se sont un peu arrangées mais je voudrais que cela aille beaucoup plus vite (2 fois au moins). Pourriez-vous me dire ce que je dois corriger ?

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
 
<html>
 
<head>
<title>Scroller</title>
<Script>
var pic = new Array()
 
function banner(name, width){
	this.name = name
	this.width = width
   }
 
pic[0] = .......pic[38] = new banner(...)
 
 
var speed = 4
 
var kk = pic.length
var ii
var hhh
var nnn
var myInterval
var myPause
var mode = 0
 
 
var imgArray = new Array(kk)
var myLeft = new Array(kk)
 
for (ii=0;ii<kk;ii++){
imgArray[ii] = new Image()
imgArray[ii].src = pic[ii].name
imgArray[ii].width = pic[ii].width
 
	hhh=0 
	for (nnn=0;nnn<ii;nnn++){
		hhh=hhh+pic[nnn].width
	}
	myLeft[ii] = hhh
}
 
function ready(){
	for (ii=0;ii<kk;ii++){ 
		if (document.images[ii].complete == false){
			return false	
			break
		}
	}
return true
}
 
 
function startScrolling(){
	if (ready() == true){		
		window.clearInterval(myPause)
		myInterval = setInterval("autoScroll()",speed)	
	}
}	
 
 
function autoScroll(){
	for (ii=0;ii<kk;ii++){
		myLeft[ii] = myLeft[ii] - 1
 
	if (myLeft[ii] == -(pic[ii].width)){
		hhh = 0
		for (nnn=0;nnn<kk;nnn++){
			if (nnn!=ii){
				hhh = hhh + pic[nnn].width
			}			
		}
		myLeft[ii] =  hhh
	}
 
 
		document.images[ii].style.left = myLeft[ii]
	}
	mode = 1
}
 
function stop(){
	if (mode == 1){
		window.clearInterval(myInterval)
	}
	if (mode == 0){
		window.clearInterval(myPause)
	}	
}
 
function go(){
	if (mode == 1){
		myInterval = setInterval("autoScroll()",speed)
	}
	if (mode == 0){
		myPause = setInterval("startScrolling()",4)
	}	
}
 
myPause = setInterval("startScrolling()",4)
</Script>
 
<body bgcolor='#FFFFFF'>
<Script>
for (ii=0;ii<kk;ii++){
document.write('<a href = ' + pic[ii].link + ' target="_blank" ><img space=0 hspace=0 vspace=0 border=0 height=55 style=position:absolute;top:0;left:' + myLeft[ii]  + '; src=' + pic[ii].name + ' onMouseOver=stop() onMouseOut=go()></a>')
}
</Script>
</body>
 
</html>