Bonsoir à tous et bonne année,
Me voilà confronté à un problème dont je ne trouve pas la réponse sur internet.
J'ai un diaporama fancybox, ce dernier est composé de quatre images (cela pourrait être dix ou deux).
Image un > image deux > image trois > image quatre.
Ce que je cherche à faire : que chaque image soit indépendante, et n'ouvre pas la suivante.
Pour tenter d'être clair, que l'image une soit l'ouverture d'une galerie, idem pour l'image deux etc...
En cliquant sur l'image une, je ne tombe pas sur l'image deux mais sur une image "image_un_b", en cliquant sur la flèche droite "image_un_c" etc...
(les images "un_b", "un_c" etc sont donc non visibles sur la page d'origine). Comme si un clic sur la flèche droite masquait un z-index de l'image concernée (je n'y connait rien en z-index, juste la connaissance de calques sur photoshop).
Je ne sais pas si les scripts vous sont d'une grande utilité, mais au cas où :
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
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
	<script type="text/javascript">
		$(document).ready(function() {
			/*
			 *  Simple image gallery. Uses default settings
			 */
 
			$('.fancybox').fancybox();
 
			/*
			 *  Different effects
			 */
 
			// Change title type, overlay closing speed
			$(".fancybox-effects-a").fancybox({
				helpers: {
					title : {
						type : 'outside'
					},
					overlay : {
						speedOut : 0
					}
				}
			});
 
			// Disable opening and closing animations, change title type
			$(".fancybox-effects-b").fancybox({
				openEffect  : 'none',
				closeEffect	: 'none',
 
				helpers : {
					title : {
						type : 'over'
					}
				}
			});
 
			// Set custom style, close if clicked, change title type and overlay color
			$(".fancybox-effects-c").fancybox({
				wrapCSS    : 'fancybox-custom',
				closeClick : true,
 
				openEffect : 'none',
 
				helpers : {
					title : {
						type : 'inside'
					},
					overlay : {
						css : {
							'background' : 'rgba(238,238,238,0.85)'
						}
					}
				}
			});
 
			// Remove padding, set opening and closing animations, close if clicked and disable overlay
			$(".fancybox-effects-d").fancybox({
				padding: 0,
 
				openEffect : 'elastic',
				openSpeed  : 150,
 
				closeEffect : 'elastic',
				closeSpeed  : 150,
 
				closeClick : true,
 
				helpers : {
					overlay : null
				}
			});
 
			/*
			 *  Button helper. Disable animations, hide close button, change title type and content
			 */
 
			$('.fancybox-buttons').fancybox({
				openEffect  : 'none',
				closeEffect : 'none',
 
				prevEffect : 'none',
				nextEffect : 'none',
 
				closeBtn  : false,
 
				helpers : {
					title : {
						type : 'inside'
					},
					buttons	: {}
				},
 
				afterLoad : function() {
					this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
				}
			});
 
 
			/*
			 *  Thumbnail helper. Disable animations, hide close button, arrows and slide to next gallery item if clicked
			 */
 
			$('.fancybox-thumbs').fancybox({
				prevEffect : 'none',
				nextEffect : 'none',
 
				closeBtn  : false,
				arrows    : false,
				nextClick : true,
 
				helpers : {
					thumbs : {
						width  : 50,
						height : 50
					}
				}
			});
 
			/*
			 *  Media helper. Group items, disable animations, hide arrows, enable media and button helpers.
			*/
			$('.fancybox-media')
				.attr('rel', 'media-gallery')
				.fancybox({
					openEffect : 'none',
					closeEffect : 'none',
					prevEffect : 'none',
					nextEffect : 'none',
 
					arrows : false,
					helpers : {
						media : {},
						buttons : {}
					}
				});
 
			/*
			 *  Open manually
			 */
 
			$("#fancybox-manual-a").click(function() {
				$.fancybox.open('1_b.jpg');
			});
 
			$("#fancybox-manual-b").click(function() {
				$.fancybox.open({
					href : 'iframe.html',
					type : 'iframe',
					padding : 5
				});
			});
 
			$("#fancybox-manual-c").click(function() {
				$.fancybox.open([
					{
						href : '1_b.jpg',
						title : 'My title'
					}, {
						href : '2_b.jpg',
						title : '2nd title'
					}, {
						href : '3_b.jpg'
					}
				], {
					helpers : {
						thumbs : {
							width: 75,
							height: 50
						}
					}
				});
			});
 
 
		});
	</script>
Merci pour votre aide et encore bonne année !
dh