質問編集履歴
3
文章の修正
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
jQueryで一定の幅に来た時にスライダーの設定を入れ替える
|
1
|
+
jQueryで一定の幅に来た時にslickスライダーの設定を入れ替える
|
body
CHANGED
File without changes
|
2
誤字
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
1
文章の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -61,4 +61,62 @@
|
|
61
61
|
}
|
62
62
|
|
63
63
|
|
64
|
-
```
|
64
|
+
```
|
65
|
+
720px以下の場合は(モバイル)
|
66
|
+
```js
|
67
|
+
$('.thumb-item').slick({
|
68
|
+
asNavFor:'.thumb-item-nav',
|
69
|
+
arrows: false,
|
70
|
+
slidesToShow:1,
|
71
|
+
});
|
72
|
+
$('.thumb-item-nav').slick({
|
73
|
+
asNavFor:'.thumb-item',
|
74
|
+
focusOnSelect: true,
|
75
|
+
arrows: false,
|
76
|
+
slidesToShow:5,
|
77
|
+
});
|
78
|
+
```
|
79
|
+
の設定にして
|
80
|
+
721以上の場合は(pc)
|
81
|
+
```js
|
82
|
+
$(function(){
|
83
|
+
var slider = "#slider";
|
84
|
+
var thumbnailItem = "#thumbnail-list .thumbnail-item";
|
85
|
+
|
86
|
+
$(thumbnailItem).each(function(){
|
87
|
+
var index = $(thumbnailItem).index(this);
|
88
|
+
$(this).attr("data-index",index);
|
89
|
+
});
|
90
|
+
|
91
|
+
|
92
|
+
$(slider).on('init',function(slick){
|
93
|
+
var index = $(".slide-item.slick-slide.slick-current").attr("data-slick-index");
|
94
|
+
$(thumbnailItem+'[data-index="'+index+'"]').addClass("thumbnail-current");
|
95
|
+
});
|
96
|
+
|
97
|
+
$(slider).slick({
|
98
|
+
autoplay: false,
|
99
|
+
arrows: false,
|
100
|
+
fade: true,
|
101
|
+
infinite: false
|
102
|
+
});
|
103
|
+
$(thumbnailItem).on('click',function(){
|
104
|
+
var index = $(this).attr("data-index");
|
105
|
+
$(slider).slick("slickGoTo",index,false);
|
106
|
+
});
|
107
|
+
|
108
|
+
$(slider).on('beforeChange',function(event,slick, currentSlide,nextSlide){
|
109
|
+
$(thumbnailItem).each(function(){
|
110
|
+
$(this).removeClass("thumbnail-current");
|
111
|
+
});
|
112
|
+
$(thumbnailItem+'[data-index="'+nextSlide+'"]').addClass("thumbnail-current");
|
113
|
+
});
|
114
|
+
});
|
115
|
+
|
116
|
+
$(function(){
|
117
|
+
var luminousTrigger = document.querySelectorAll('.luminous');
|
118
|
+
new LuminousGallery(luminousTrigger);
|
119
|
+
});
|
120
|
+
```
|
121
|
+
調べた結果一番上のような記述が出てきましたがうまくいきませんでした。
|
122
|
+
PCサイズの場合はスライダーのメイン画像をクリックすると拡大するような設定し、モバイルの場合はスライダーのみの設定にしたく考えております。
|