Précédent   Forum du club des développeurs et IT Pro > Webmasters - Développement Web > CSS
CSS Forum d'entraide sur l'utilisation des feuilles de style CSS. Avant de poster : Cours CSS, FAQ CSS, Galerie CSS
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 20/01/2013, 02h03   #1
thomson75
Invité de passage
 
Homme
Lycéen
Inscription : janvier 2013
Messages : 3
Détails du profil
Informations personnelles :
Sexe : Homme

Informations professionnelles :
Activité : Lycéen
Secteur : Enseignement

Informations forums :
Inscription : janvier 2013
Messages : 3
Points : 0
Points : 0
Par défaut Réaliser un slideshow avec le CSS

Salut a tous!
Je suis nouveau sur le forum, je souhaite réaliser un slideshow automatique avec le css, j'y suis presque mais les images ne défilent pas, j'ai sans doute un problème au niveau de ma timeline.
Quelqu'un peut-il m'aider?
d'avance merci.
thomson75 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 20/01/2013, 02h14   #2
Muchos
Membre Expert
 
Avatar de Muchos
 
Homme Jonathan Renoult
Étudiant
Inscription : décembre 2011
Messages : 884
Détails du profil
Informations personnelles :
Nom : Homme Jonathan Renoult
Âge : 27
Localisation : France, Calvados (Basse Normandie)

Informations professionnelles :
Activité : Étudiant
Secteur : Arts - Culture

Informations forums :
Inscription : décembre 2011
Messages : 884
Points : 1 870
Points : 1 870
Citation:
j'ai sans doute un problème au niveau de ma timeline.
Sans doute Mais sans tes codes, on pourra pas beaucoup t'aider !
__________________


Pour être aidé, donnez vos codes source svp ! ( balise # )
- - -
Debug the Web together!

Muchos est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 22/01/2013, 00h06   #3
thomson75
Invité de passage
 
Homme
Lycéen
Inscription : janvier 2013
Messages : 3
Détails du profil
Informations personnelles :
Sexe : Homme

Informations professionnelles :
Activité : Lycéen
Secteur : Enseignement

Informations forums :
Inscription : janvier 2013
Messages : 3
Points : 0
Points : 0
Bonjour Muchoz,

Voici mon code html et css.

HTML
Code html :
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
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
 
<head>
 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
<link href="junior.css" rel="stylesheet" type="text/css" media="screen"/>
 
<title>slideshow</title>
 
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
 
 
 
</head>
 
<body>
<section id="slideshow">  
 
			<span id="sl_play" class="sl_command"></span>  
			<span id="sl_pause" class="sl_command"></span>  
			<span id="sl_i1" class="sl_command sl_i"></span>  
			<span id="sl_i2" class="sl_command sl_i"></span>  
			<span id="sl_i3" class="sl_command sl_i"></span>  
			<span id="sl_i4" class="sl_command sl_i"></span>  
 
 
		<a class="play_commands pause" href="#sl_pause" title="Maintain paused">Pause</a>  
		<a class="play_commands play" href="#sl_play" title="Play the animation">play</a>  
 
		<a class="commands prev commands1" href="#img/image5.jpg" title="Aller à la dernière slide"tabindex-1>&lt;</a>  
		<a class="commands next commands1" href="#img/image2.jpg" title="Aller à la 2ème slide"tabindex-1>&gt;</a>  
		<a class="commands prev commands2" href="#img/image1.jpg" title="Aller à la 1ère slide"tabindex-1>&lt;</a>  
		<a class="commands next commands2" href="#img/image3.jpg" title="Aller à la 3ème slide"tabindex-1>&gt;</a>  
		<a class="commands prev commands3" href="#img/image2.jpg" title="Aller à la 2ème slide"tabindex-1>&lt;</a>  
		<a class="commands next commands3" href="#img/image4.jpg" title="Aller à la 4ème slide"tabindex-1>&gt;</a>  
		<a class="commands prev commands4" href="#img/image3.jpg" title="Aller à la 3ème slide"tabindex-1>&lt;</a>  
		<a class="commands next commands4" href="#img/image1.jpg" title="Aller à la 1ère slide"tabindex-1>&gt;</a>  
 
		<div class="container">  
 
		<div class="c_slider">  
 
			<div class="slider">  
 
				<figure>  
					<img src="img/image1.jpg" alt="" width="700" height="300" />  
					<figcaption>L'avancé du desert</figcaption>  
				</figure> 
 
				<figure> 
					<img src="img/image2.jpg" alt="" width="700" height="300" />  
					<figcaption>Let's cross that bridge when we come to it</figcaption>  
				</figure><!--  -->
 
				<figure> 
					<img src="img/image4.jpg" alt="" width="700" height="300" />  
					<figcaption>Sushi<em>(do)</em> time</figcaption>  
				</figure><!-- -->
 
				<figure>  
					<img src="img/image5.jpg" alt="" width="700" height="300" />  
					<figcaption>Waking Life</figcaption>  
				</figure>  
			</div>  
		  </div>
	</div>
 
			<span id="timeline">  </span>  
 
				<ul class="dots_commands"><!-- 
	    --><li><a title="image1" href="img/image1.jpg">image1</a></li><!-- 
	    --><li><a title="image2" href="img/image2.jpg">image2</a></li><!-- 
	    --><li><a title="image3" href="img/image4.jpg">image3</a></li><!-- 
	    --><li><a title="image4" href="img/image5.jpg">image4</a></li>  
				</ul>  
 
 
 
 
 
	</section> 
 
 
</body>
 
</html>


CSS
Code css :
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
/*CODE CSS3*/
#slideshow {  
    position: relative;  
    width: 700px;  
    height: 300px;  
    padding: 15px;  
    margin: 0 auto 2em;  
    border: 1px solid #ddd;  
    background: #FFF;  
    /* CSS3 effects */  
    background: linear-gradient(#FFF, #FFF 20%, #EEE 80%, #DDD);  
    border-radius: 2px 2px 2px 2px;  
    box-shadow: 0 0 3px rgba(0,0,0, 0.2); 
	border-color:gray;	
}  
#slideshow:before,  
#slideshow:after {  
    position: absolute;  
    bottom:16px;  
    z-index: -10;  
    width: 50%;  
    height: 20px;  
    content: " ";  
    background: rgba(0,0,0,0.1);  
    border-radius: 50%;  
    box-shadow: 0 0 3px rgba(0,0,0, 0.4), 0 20px 10px rgba(0,0,0, 0.7);  
}  
#slideshow:before {  
    left:0;  
    transform: rotate(-4deg);  
}  
#slideshow:after {  
    right:0;  
    transform: rotate(4deg);  
}  
 
 
/*TRANSFORMATION DU CSS3*/
/* gestion des dimensions et d&#43247;rdement du conteneur */  
#slideshow .container {  
    position:relative;  
    width: 700px;  
    height: 300px;  
    overflow: hidden;  
	border-color:gray;
}  
/* on pr&#44527;it un petit espace gris pour la timeline */  
#slideshow .container:after {  
    position:absolute;  
    bottom: 0; left:0;  
    content: " ";  
    width: 100%;  
    height: 1px;  
    background: #999;  
}  
/* 
   le conteneur des slides 
   en largeur il fait 100% x le nombre de slides 
*/  
#slideshow .slider {  
    position: absolute;  
    left:0; top:0;  
    width: 400%;  
    height: 300px;  
}  
/* annulation des marges sur figure */  
#slideshow figure {  
    position:relative;  
    display:inline-block;  
    padding:0; margin:0;  
}  
/* petit effet de vignette sur les images */  
#slideshow figure:after {  
    position: absolute;  
    display:block;  
    content: " ";  
    top:0; left:0;  
    width: 100%; height: 100%;  
    box-shadow: 0 0 65px rgba(0,0,0, 0.5) inset;  
}  
/*SYLER LES LEGENDES*/
/* styles de nos l&#43557;ndes */  
#slideshow figcaption {  
    position:absolute;  
    left:0; right:0; bottom: 5px;  
    padding: 10px;  
    margin:0;  
    border-top: 1px solid rgb(225,225,225);  
    text-align:center;  
    letter-spacing: 0.05em;  
    word-spacing: 0.05em;  
    font-family: Georgia, Times, serif;  
    background: ;  
    background: rgba(255,255,255,0.7);  
    color: #555;  
    text-shadow: -1px -1px 0 rgba(255,255,255,0.3);  
}  
 
 
 
 
 
/*ANIMATION*/
/* fonction d'animation, n'oubliez pas de prefixer ! */  
@keyframes slider {  
    0%, 20%, 100%   { left: 0 }  
    25%, 45%        { left: -100% }  
    50%, 70%        { left: -200% }  
    75%, 95%        { left: -300% }  
 
}  
 
 
	-webkit-transition:{
	[
	0%, 20%, 100%   { left: 0 }  
    25%, 45%        { left: -100% }  
    50%, 70%        { left: -200% }  
    75%, 95%        { left: -300% }  
	]
	}
	-moz-transition:{
	[
	0%, 20%, 100%   { left: 0 }  
    25%, 45%        { left: -100% }  
    50%, 70%        { left: -200% }  
    75%, 95%        { left: -300% }  
	]
	}
	-o-transition:{
	[
	0%, 20%, 100%   { left: 0 }  
    25%, 45%        { left: -100% }  
    50%, 70%        { left: -200% }  
    75%, 95%        { left: -300% }  
	]
	}
	 transition:{
	 [
	 0%, 20%, 100%   { left: 0 }  
    25%, 45%        { left: -100% }  
    50%, 70%        { left: -200% }  
    75%, 95%        { left: -300% }  
	 ]
	 }
 
 
 
 
 
/* compl&#44389;z le s&#43877;cteur : */  
#slideshow .slider {  
    /* ... avec la propri&#44393; animation */  
    animation: slider 40s infinite;  
}  
#timeline {  
    position: absolute;  
    background: #999;  
    bottom: 15px;  
    left: 15px;  
    height: 1px;  
    background: rgb(214,98,13);  
    background: rgba(214,98,13,.8);  
    width: 0;  
    /* fonction d'animation */  
    animation: timeliner 40s infinite;  
}  
 
@keyframes timeliner {  
    0%, 25%, 50%, 75%, 100% { width: 0;     }  
    20%, 45%, 70%, 90%      { width: 400px; }  
}  
@keyframes figcaptionner {  
    0%, 25%, 50%, 75%, 100%                     { bottom: -55px;    }  
    5%, 20%, 30%, 45%, 55%, 70%, 80%, 95%       { bottom: 5px;      }  
}  
/* ajouter &#2156;'&#43881;ment : */  
#slideshow figcaption {  
    /* ... la propri&#44393; animation */  
    animation: figcaptionner 40s infinite;  
}  
 
 .play_commands {  
    /* positionnement en haut &#2148;roite */  
    position: absolute;  
    top: 25px; right: 55px;  
    z-index: 10;  
    /* dimensionnement des ic&#65533;&#65533; */  
    width: 22px;  
    height: 22px;  
    text-indent: -9999px;  
    border:0 none;  
    /* placez l'opacit&#39008; 1 si vous souhaitez voir les commandes */  
    opacity: 0;  
    /* pr&#44129;ration de transition sur opacicty et right */  
    transition: opacity 1s, right 1s;  
}  
/* on d&#43297;le play l&#43560;rement sur la gauche */  
.play { right: 25px; cursor: pointer; }  
 
/* cr&#43188;ion de l'ic&#65533;&#65533;pause avec 2 pseudos &#43881;ments */  
.pause:after,  
.pause:before {  
    position: absolute;  
    display: block;  
    content: " ";  
    top:0;  
    width:38%;  
    height: 22px;  
    background: #fff;  
    background: rgba(255,255,255,0.5);  
}  
.pause:after { right:0; }  
.pause:before { left:0; }  
 
/* cr&#43188;ion de l'ic&#65533;&#65533;play avec des bordures */  
.play {  
    width: 1px;  
    height: 1px;  
    /* les transparentes forment la fl&#39208;e */  
    border-top: 10px solid transparent;  
    border-bottom: 10px solid transparent;  
    border-left: 20px solid #fff;  
    border-left: 20px solid rgba(255,255,255,0.5);  
    /* renseignez 1 a opacity pour voir l'ic&#65533;&#65533;de suite  et 0 pour la cacher*/  
    opacity: 1;  
}  
 
/* apparition du bouton pause au survole */  
/* apparition des boutons au focus */  
#slideshow:hover .pause,  
.play_commands:focus {  
    opacity: 1;  
    outline: none;  
}  
 /* stopper les animation */  
.sl_command:target ~ #slideshow .slider,  
.sl_command:target ~ #slideshow figcaption,  
.sl_command:target ~ #slideshow #timeline,  
.sl_command:target ~ #slideshow .dots_commands li:first-child a:after {  
    animation-play-state: paused;  
}  
 
/* red&#43937;rrer les animations */  
#sl_play:target ~ #slideshow .slider,  
#sl_play:target ~ #slideshow figcaption,  
#sl_play:target ~ #slideshow #timeline,  
#sl_play:target ~ #slideshow .dots_commands li:first-child a:after {  
    animation-play-state: running;  
}  
 
/* switch entre les boutons */  
.sl_command:target ~ #slideshow .pause      { opacity:1; }  
#sl_play:target ~ #slideshow:hover .pause,  
#sl_play:target ~ #slideshow .pause:focus   { opacity:1; }  
.sl_command:target ~ #slideshow .play       { opacity:1; right: 25px; cursor: pointer; }  
#sl_play:target ~ #slideshow .play          { opacity:0; right: 55px; cursor: default; }  
 
 
#slideshow .commands {  
    position: absolute;  
    top: 45%;  
    padding: 5px 13px;  
    border-bottom:0;  
    font-size: 1.3em;  
    color: #aaa;  
    text-decoration:none;  
    background-color: #eee;  
    background-image: linear-gradient(#fff,#ddd);  
    text-shadow: 0 0 1px #aaa;  
    border-radius: 50%;  
    box-shadow: 1px 1px 2px rgba(0,0,0,0.2);  
}  
 
#slideshow .prev { left: -48px; }  
#slideshow .next { right: -48px; }  
 
#slideshow .commands { display:none; }  
#slideshow .commands1 { display: block; }  
#slideshow .c_slider {  
    position: absolute;  
    left:0; top:0;  
    width: 400%;  
    height: 300px;  
    /* multiple background */  
    background: url(img/image1.jpg) 0 0 no-repeat,  
                url(img/image2.jpg) 400px 0 no-repeat,  
                url(img/image4.jpg) 800px 0 no-repeat,  
                url(img/image5.jpg) 1200px 0 no-repeat;  
    transition: background 1s;  
}  
 
 
 
 
 
/* on cache le slider */  
.sl_i:target ~ #slideshow .slider                                   { visibility: hidden }  
/* on planque la 1&#40165; pastille (cf. bonux suivant) */  
.sl_i:target ~ #slideshow .dots_commands li:first-child a:after     { display:none; }  
/* pour afficher la 2&#39845; pastille (cf. bonux suivant) */  
.sl_i:target ~ #slideshow .dots_commands li:first-child a:before    { display:block; }  
 
/* lorsque on cible le premier slider */  
/* on cache tous les "pr&#43305;dent" et "suivant" */  
#sl_i1:target ~ #slideshow .commands                                { display: none; }  
/* on affiche seulement deux fl&#39208;es */  
#sl_i1:target ~ #slideshow .commands1                               { display: block; }  
/* correspond au d&#43297;lage des images */  
#sl_i1:target ~ #slideshow .c_slider                                { background-position: 0 0, 400px 0, 800px 0, 1200px 0; }  
/* on place la pastille tout &#2151;auche */  
#sl_i1:target ~ #slideshow .dots_commands li:first-child a:before   { left:0; }  
 
/* m&#48037; proc&#43369; lorsqu'on cible le second slide */  
#sl_i2:target ~ #slideshow .commands                                { display: none; }  
#sl_i2:target ~ #slideshow .commands2                               { display: block; }  
#sl_i2:target ~ #slideshow .c_slider                                { background-position: -400px 0, 0 0, 400px 0, 1200px 0; }  
#sl_i2:target ~ #slideshow .dots_commands li:first-child a:before   { left:18px; }  
 
/* puis le 3&#39845; */  
#sl_i3:target ~ #slideshow .commands                                { display: none; }  
#sl_i3:target ~ #slideshow .commands3                               { display: block; }  
#sl_i3:target ~ #slideshow .c_slider                                { background-position: -1200px 0, -400px 0, 0 0, 400px 0; }  
#sl_i3:target ~ #slideshow .dots_commands li:first-child a:before   { left:36px; }  
 
/* et enfin le 4&#39845; */  
#sl_i4:target ~ #slideshow .commands                                { display: none; }  
#sl_i4:target ~ #slideshow .commands4                               { display: block; }  
#sl_i4:target ~ #slideshow .c_slider                                { background-position: -1200px 0, -1200px 0, -400px 0, 0 0; }  
#sl_i4:target ~ #slideshow .dots_commands li:first-child a:before   { left:54px; }  
 
.dots_commands  {  
    padding:0;  
    margin:32px 0 0;  
    text-align: center;  
}  
.dots_commands li {  
    display: inline;  
    padding:0; margin:0;  
}  
.dots_commands a {  
    position: relative;  
    display: inline-block;  
    height:8px; width: 8px;  
    margin: 0 5px;  
    text-indent: -9999px;  
    background: #fff;  
 
    border-radius: 50%;  
    box-shadow: 0 1px 2px rgba(0,0,0,0.55) inset;  
}  
/* quelques styles au focus */  
.dots_commands a:focus {  
    outline: none;  
    background: orange;  
}  
.dots_commands li:first-child a { z-index: 25; }  
 
 
 
 
 
/* on style after et before, on utilisera les deux */  
.dots_commands li:first-child a:after,  
.dots_commands li:first-child a:before {  
    position: absolute;  
    top: 0; left: 0;  
    content: " ";  
    width: 8px; height: 8px;  
    background: #bd9b83;  
    z-index:20;  
    border-radius: 50%;  
    box-shadow: 0 1px 2px rgba(0,0,0,0.55) inset;  
}  
/* on anime "after" */  
.dots_commands li:first-child a:after {  
    animation: dotser 40s infinite;  
}  
/* on cache "before", on l'utilise uniquement au clic (cf. bonux pr&#43305;dent) */  
.dots_commands li:first-child a:before { display:none; }  
 
/* c'est parti pour l'animation ! */  
@keyframes dotser {  
    0%, 100%    { opacity: 1; left: 0;      }  
 
    20%         { opacity: 1; left: 0;      }  
    22%         { opacity: 0; left: 0;      }  
    23%         { opacity: 0; left: 18px;   }  
    25%         { opacity: 1; left: 18px;   }  
 
    45%         { opacity: 1; left: 18px;   }  
    47%         { opacity: 0; left: 18px;   }  
    48%         { opacity: 0; left: 36px;   }  
    50%         { opacity: 1; left: 36px;   }  
 
    70%         { opacity: 1; left: 36px;   }  
    72%         { opacity: 0; left: 36px;   }  
    73%         { opacity: 0; left: 54px;   }  
    75%         { opacity: 1; left: 54px;   }  
 
    95%         { opacity: 1; left: 54px;   }  
    97%         { opacity: 0; left: 54px;   }  
    98%         { opacity: 0; left: 0;  }  
}
thomson75 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 00h14.


 
 
 
 
Partenaires

Hébergement Web