質問編集履歴
1
コードを追加しました。お手数ですが確認お願いします。
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,3 +1,311 @@
|
|
1
1
|
現在[こちら](https://www.linguage-school.jp/lp/)のLPの模写をしているのですが、下の画像のスライダーの仕組みが理解できずに止まってしまっています。スライダーのプラグインは、「[slick](https://kenwheeler.github.io/slick/)」が使われているようなのですが、下の画像のようなスライダーの設定がなく、どのように設計していいのかわかりません。どなたかアドバイスしていただけると幸いです。
|
2
2
|
|
3
3
|
![イメージ説明](ac32e8f49433ce4cb05a5013695babb9.png)
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
追記
|
8
|
+
|
9
|
+
見た目だけはできたのですが、一つ移動すると、止まってしまいます。slickのオプションでfocusOnSelect: trueを使用しているので、クリックして移動してみたのですが、一つ移動すると、他のものに移動できなくなってしいます。また、移動するとセンターが移動したことになっているのですが、その要素が中央にこないです。
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
```html
|
14
|
+
|
15
|
+
<ul class="teacher-slider">
|
16
|
+
|
17
|
+
<div class="slider-inner">
|
18
|
+
|
19
|
+
<li>
|
20
|
+
|
21
|
+
<div class="teacher-item">
|
22
|
+
|
23
|
+
<img src="https://www.linguage-school.jp/wp-content/themes/linguage/img/lp/img-inst-lidia.jpg" alt="Lidia">
|
24
|
+
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<p>Lidia</p>
|
28
|
+
|
29
|
+
</li>
|
30
|
+
|
31
|
+
<li>
|
32
|
+
|
33
|
+
<div class="teacher-item">
|
34
|
+
|
35
|
+
<img src="https://www.linguage-school.jp/wp-content/themes/linguage/img/lp/img-inst-erika.jpg" alt="Erika">
|
36
|
+
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<p>Erika</p>
|
40
|
+
|
41
|
+
</li>
|
42
|
+
|
43
|
+
<li>
|
44
|
+
|
45
|
+
<div class="teacher-item">
|
46
|
+
|
47
|
+
<img src="https://www.linguage-school.jp/wp-content/themes/linguage/img/lp/img-inst-joel.jpg" alt="Joel">
|
48
|
+
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<p>Joel</p>
|
52
|
+
|
53
|
+
</li>
|
54
|
+
|
55
|
+
<li>
|
56
|
+
|
57
|
+
<div class="teacher-item">
|
58
|
+
|
59
|
+
<img src="https://www.linguage-school.jp/wp-content/themes/linguage/img/lp/img-inst-sesin.jpg" alt="Sesin">
|
60
|
+
|
61
|
+
</div>
|
62
|
+
|
63
|
+
<p>Sesin</p>
|
64
|
+
|
65
|
+
</li>
|
66
|
+
|
67
|
+
<li>
|
68
|
+
|
69
|
+
<div class="teacher-item">
|
70
|
+
|
71
|
+
<img src="https://www.linguage-school.jp/wp-content/themes/linguage/img/lp/img-inst-anastasios.jpg" alt="Anastasios">
|
72
|
+
|
73
|
+
</div>
|
74
|
+
|
75
|
+
<p>Anastasios</p>
|
76
|
+
|
77
|
+
</li>
|
78
|
+
|
79
|
+
<li>
|
80
|
+
|
81
|
+
<div class="teacher-item">
|
82
|
+
|
83
|
+
<img src="https://www.linguage-school.jp/wp-content/themes/linguage/img/lp/img-inst-staci.jpg" alt="Staci">
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<p>Staci</p>
|
88
|
+
|
89
|
+
</li>
|
90
|
+
|
91
|
+
<li>
|
92
|
+
|
93
|
+
<div class="teacher-item">
|
94
|
+
|
95
|
+
<img src="https://www.linguage-school.jp/wp-content/themes/linguage/img/lp/img-inst-karen.jpg" alt="Karen">
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
<p>Karen</p>
|
100
|
+
|
101
|
+
</li>
|
102
|
+
|
103
|
+
<li>
|
104
|
+
|
105
|
+
<div class="teacher-item">
|
106
|
+
|
107
|
+
<img src="https://www.linguage-school.jp/wp-content/themes/linguage/img/lp/img-inst-mathias.jpg" alt="Mathias">
|
108
|
+
|
109
|
+
</div>
|
110
|
+
|
111
|
+
<p>Mathias</p>
|
112
|
+
|
113
|
+
</li>
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
</ul>
|
118
|
+
|
119
|
+
```
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
```css
|
124
|
+
|
125
|
+
.teacher-slider{
|
126
|
+
|
127
|
+
padding-left: 0;
|
128
|
+
|
129
|
+
width: 980px;
|
130
|
+
|
131
|
+
max-width: 100%;
|
132
|
+
|
133
|
+
margin: 0 auto;
|
134
|
+
|
135
|
+
}
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
.slider-inner{
|
140
|
+
|
141
|
+
height: 121px;
|
142
|
+
|
143
|
+
max-width: 100%;
|
144
|
+
|
145
|
+
margin: 0 auto;
|
146
|
+
|
147
|
+
padding: 0 40px;
|
148
|
+
|
149
|
+
text-align: center;
|
150
|
+
|
151
|
+
}
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
.teacher-slider .slick-slide img{
|
156
|
+
|
157
|
+
width: 100px;
|
158
|
+
|
159
|
+
height: 100px;
|
160
|
+
|
161
|
+
border-radius: 50%;
|
162
|
+
|
163
|
+
margin: 0 auto;
|
164
|
+
|
165
|
+
border: 4px solid #ff679a;
|
166
|
+
|
167
|
+
}
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
.slider-inner p{
|
172
|
+
|
173
|
+
font-size: 1.4rem;
|
174
|
+
|
175
|
+
font-weight: bold;
|
176
|
+
|
177
|
+
}
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
.slider-inner .slick-slide:not(.slick-center) img{
|
182
|
+
|
183
|
+
border: 2px solid #ddd;
|
184
|
+
|
185
|
+
width: 64px;
|
186
|
+
|
187
|
+
height: 64px;
|
188
|
+
|
189
|
+
}
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
.slider-inner .slick-slide:not(.slick-center){
|
194
|
+
|
195
|
+
width: 136px;
|
196
|
+
|
197
|
+
height: 85px;
|
198
|
+
|
199
|
+
outline: none;
|
200
|
+
|
201
|
+
}
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
.teacher-slider .prev-arrow{
|
206
|
+
|
207
|
+
position: absolute;
|
208
|
+
|
209
|
+
left: 0;
|
210
|
+
|
211
|
+
top: 10px;
|
212
|
+
|
213
|
+
height: 40px;
|
214
|
+
|
215
|
+
width: 40px;
|
216
|
+
|
217
|
+
}
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
.teacher-slider .next-arrow{
|
222
|
+
|
223
|
+
position: absolute;
|
224
|
+
|
225
|
+
right: 0;
|
226
|
+
|
227
|
+
top: 10px;
|
228
|
+
|
229
|
+
height: 40px;
|
230
|
+
|
231
|
+
width: 40px;
|
232
|
+
|
233
|
+
}
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
.teacher-slider .slide-arrow:hover{
|
238
|
+
|
239
|
+
cursor: pointer;
|
240
|
+
|
241
|
+
opacity: 0.8;
|
242
|
+
|
243
|
+
}
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
```
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
```Javascript
|
252
|
+
|
253
|
+
<script type="text/javascript">
|
254
|
+
|
255
|
+
jQuery(function(){
|
256
|
+
|
257
|
+
// teacher-slides
|
258
|
+
|
259
|
+
$(".teacher-comment").slick({
|
260
|
+
|
261
|
+
slidesToShow: 1,
|
262
|
+
|
263
|
+
slidesToScroll: 1,
|
264
|
+
|
265
|
+
speed: 500,
|
266
|
+
|
267
|
+
arrows: false,
|
268
|
+
|
269
|
+
fade: true,
|
270
|
+
|
271
|
+
asNavFor: ".slider-inner"
|
272
|
+
|
273
|
+
});
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
$(".slider-inner").slick({
|
278
|
+
|
279
|
+
dots: false,
|
280
|
+
|
281
|
+
infinite: true,
|
282
|
+
|
283
|
+
slidesToShow: 7,
|
284
|
+
|
285
|
+
slidesToScroll: 1,
|
286
|
+
|
287
|
+
variableWidth: true,
|
288
|
+
|
289
|
+
speed: 500,
|
290
|
+
|
291
|
+
asNavFor: ".teacher-comment",
|
292
|
+
|
293
|
+
centerMode: true,
|
294
|
+
|
295
|
+
focusOnSelect: true,
|
296
|
+
|
297
|
+
slide: "li",
|
298
|
+
|
299
|
+
prevArrow: '<img src="https://www.linguage-school.jp/wp-content/themes/linguage/img/lp/arrow-slide_l.png" class="slide-arrow prev-arrow">',
|
300
|
+
|
301
|
+
nextArrow: '<img src="https://www.linguage-school.jp/wp-content/themes/linguage/img/lp/arrow-slide_r.png" class="slide-arrow next-arrow">'
|
302
|
+
|
303
|
+
});
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
});
|
308
|
+
|
309
|
+
</script>
|
310
|
+
|
311
|
+
```
|