質問編集履歴

3

文章の修正

2019/02/06 12:18

投稿

masaru_666
masaru_666

スコア13

test CHANGED
@@ -1 +1 @@
1
- jQueryで一定の幅に来た時にスライダーの設定を入れ替える
1
+ jQueryで一定の幅に来た時にslickスライダーの設定を入れ替える
test CHANGED
File without changes

2

誤字

2019/02/06 12:18

投稿

masaru_666
masaru_666

スコア13

test CHANGED
File without changes
test CHANGED
File without changes

1

文章の修正

2019/02/06 12:17

投稿

masaru_666
masaru_666

スコア13

test CHANGED
File without changes
test CHANGED
@@ -125,3 +125,119 @@
125
125
 
126
126
 
127
127
  ```
128
+
129
+ 720px以下の場合は(モバイル)
130
+
131
+ ```js
132
+
133
+ $('.thumb-item').slick({
134
+
135
+ asNavFor:'.thumb-item-nav',
136
+
137
+ arrows: false,
138
+
139
+ slidesToShow:1,
140
+
141
+ });
142
+
143
+ $('.thumb-item-nav').slick({
144
+
145
+ asNavFor:'.thumb-item',
146
+
147
+ focusOnSelect: true,
148
+
149
+ arrows: false,
150
+
151
+ slidesToShow:5,
152
+
153
+ });
154
+
155
+ ```
156
+
157
+ の設定にして
158
+
159
+ 721以上の場合は(pc)
160
+
161
+ ```js
162
+
163
+ $(function(){
164
+
165
+ var slider = "#slider";
166
+
167
+ var thumbnailItem = "#thumbnail-list .thumbnail-item";
168
+
169
+
170
+
171
+ $(thumbnailItem).each(function(){
172
+
173
+ var index = $(thumbnailItem).index(this);
174
+
175
+ $(this).attr("data-index",index);
176
+
177
+ });
178
+
179
+
180
+
181
+
182
+
183
+ $(slider).on('init',function(slick){
184
+
185
+ var index = $(".slide-item.slick-slide.slick-current").attr("data-slick-index");
186
+
187
+ $(thumbnailItem+'[data-index="'+index+'"]').addClass("thumbnail-current");
188
+
189
+ });
190
+
191
+
192
+
193
+ $(slider).slick({
194
+
195
+ autoplay: false,
196
+
197
+ arrows: false,
198
+
199
+ fade: true,
200
+
201
+ infinite: false
202
+
203
+ });
204
+
205
+ $(thumbnailItem).on('click',function(){
206
+
207
+ var index = $(this).attr("data-index");
208
+
209
+ $(slider).slick("slickGoTo",index,false);
210
+
211
+ });
212
+
213
+
214
+
215
+ $(slider).on('beforeChange',function(event,slick, currentSlide,nextSlide){
216
+
217
+ $(thumbnailItem).each(function(){
218
+
219
+ $(this).removeClass("thumbnail-current");
220
+
221
+ });
222
+
223
+ $(thumbnailItem+'[data-index="'+nextSlide+'"]').addClass("thumbnail-current");
224
+
225
+ });
226
+
227
+ });
228
+
229
+
230
+
231
+ $(function(){
232
+
233
+ var luminousTrigger = document.querySelectorAll('.luminous');
234
+
235
+ new LuminousGallery(luminousTrigger);
236
+
237
+ });
238
+
239
+ ```
240
+
241
+ 調べた結果一番上のような記述が出てきましたがうまくいきませんでした。
242
+
243
+ PCサイズの場合はスライダーのメイン画像をクリックすると拡大するような設定し、モバイルの場合はスライダーのみの設定にしたく考えております。