質問編集履歴
3
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -48,6 +48,8 @@
|
|
48
48
|
|
49
49
|
</div>
|
50
50
|
|
51
|
+
```
|
52
|
+
|
51
53
|
```js
|
52
54
|
|
53
55
|
var swiper = new Swiper('.swiper-container', {
|
@@ -83,6 +85,8 @@
|
|
83
85
|
});
|
84
86
|
|
85
87
|
```
|
88
|
+
|
89
|
+
|
86
90
|
|
87
91
|
```css
|
88
92
|
|
2
プログラム追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,7 +6,149 @@
|
|
6
6
|
|
7
7
|
作る際はこちらの質問を参考にしました。https://teratail.com/questions/57296
|
8
8
|
|
9
|
+
```html
|
9
10
|
|
11
|
+
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.1.0/css/swiper.min.css
|
12
|
+
|
13
|
+
">
|
14
|
+
|
15
|
+
<script type="text/javascript" src=“https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.1.0/js/swiper.min.js"></script>
|
16
|
+
|
17
|
+
<div class="container">
|
18
|
+
|
19
|
+
<div class="swiper-container">
|
20
|
+
|
21
|
+
<div class="swiper-wrapper">
|
22
|
+
|
23
|
+
<div class="swiper-slide">
|
24
|
+
|
25
|
+
<a href="#a"><img src="https://placehold.jp/800x300.png" alt=""></a>
|
26
|
+
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div class="swiper-slide">
|
30
|
+
|
31
|
+
<a href="#a"><img src="https://placehold.jp/800x300.png" alt=""></a>
|
32
|
+
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div class="swiper-slide">
|
36
|
+
|
37
|
+
<a href="#a"><img src="https://placehold.jp/800x300.png" alt=""></a>
|
38
|
+
|
39
|
+
</div>
|
40
|
+
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div class="swiper-button-prev"></div>
|
44
|
+
|
45
|
+
<div class="swiper-button-next"></div>
|
46
|
+
|
47
|
+
</div>
|
48
|
+
|
49
|
+
</div>
|
50
|
+
|
51
|
+
```js
|
52
|
+
|
53
|
+
var swiper = new Swiper('.swiper-container', {
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
slidesPerView: 3,
|
58
|
+
|
59
|
+
autoplay: 5000,
|
60
|
+
|
61
|
+
speed: 1000,
|
62
|
+
|
63
|
+
loop: true,
|
64
|
+
|
65
|
+
pagination: '.swiper-pagination',
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
// ナビゲーションボタン
|
70
|
+
|
71
|
+
nextButton: '.swiper-button-next',
|
72
|
+
|
73
|
+
prevButton: '.swiper-button-prev',
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
// 1スライドごとの余白
|
78
|
+
|
79
|
+
spaceBetween: 20
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
});
|
84
|
+
|
85
|
+
```
|
86
|
+
|
87
|
+
```css
|
88
|
+
|
89
|
+
.container {
|
90
|
+
|
91
|
+
overflow: hidden;
|
92
|
+
|
93
|
+
width: 100%;
|
94
|
+
|
95
|
+
}
|
96
|
+
|
97
|
+
.swiper-container {
|
98
|
+
|
99
|
+
width: 150%;
|
100
|
+
|
101
|
+
margin: 0 -25%;
|
102
|
+
|
103
|
+
}
|
104
|
+
|
105
|
+
.swiper-button-prev {
|
106
|
+
|
107
|
+
left: calc(10px + 25%);
|
108
|
+
|
109
|
+
}
|
110
|
+
|
111
|
+
.swiper-button-next {
|
112
|
+
|
113
|
+
right: calc(10px + 25%);
|
114
|
+
|
115
|
+
}
|
116
|
+
|
117
|
+
.swiper-slide {
|
118
|
+
|
119
|
+
pointer-events: none;
|
120
|
+
|
121
|
+
opacity: .5;
|
122
|
+
|
123
|
+
-webkit-transition: opacity .5s;
|
124
|
+
|
125
|
+
-moz-transition: opacity .5s;
|
126
|
+
|
127
|
+
-ms-transition: opacity .5s;
|
128
|
+
|
129
|
+
-o-transition: opacity .5s;
|
130
|
+
|
131
|
+
transition: opacity .5s;
|
132
|
+
|
133
|
+
}
|
134
|
+
|
135
|
+
.swiper-slide-next {
|
136
|
+
|
137
|
+
pointer-events: auto;
|
138
|
+
|
139
|
+
opacity: 1;
|
140
|
+
|
141
|
+
}
|
142
|
+
|
143
|
+
.swiper-slide img {
|
144
|
+
|
145
|
+
width: 100%;
|
146
|
+
|
147
|
+
}
|
148
|
+
|
149
|
+
```
|
150
|
+
|
151
|
+
```
|
10
152
|
|
11
153
|
やりたいこと
|
12
154
|
|
@@ -18,17 +160,7 @@
|
|
18
160
|
|
19
161
|
z-indexで最上面に表示することは出来ましたが、他のプラグインlity.jsを利用している為うまくできなかったこと。
|
20
162
|
|
21
|
-
```css
|
22
163
|
|
23
|
-
width: xxxxpx;
|
24
|
-
|
25
|
-
position: absolute;
|
26
|
-
|
27
|
-
top:xxpx;
|
28
|
-
|
29
|
-
left:xxpx;
|
30
|
-
|
31
|
-
```
|
32
164
|
|
33
165
|
position: absoluteで位置設定で表示は出来るがレスポンシブに出来なかった為こちらで相談させていただきました。
|
34
166
|
|
1
ソースの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -33,3 +33,5 @@
|
|
33
33
|
position: absoluteで位置設定で表示は出来るがレスポンシブに出来なかった為こちらで相談させていただきました。
|
34
34
|
|
35
35
|
恐れ入りますが、ご教示の程よろしくお願いいたします。
|
36
|
+
|
37
|
+
追記:作ったソースになります。https://jsfiddle.net/gn333d67/2/
|