teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

html、css、jsのコードを追加しました。

2016/03/18 09:34

投稿

ShunYoshizawa
ShunYoshizawa

スコア103

title CHANGED
File without changes
body CHANGED
@@ -18,5 +18,269 @@
18
18
  でも私は他の画像が自然とスライドするように、
19
19
  最後の画像から最初の画像にループする際も自然にループして欲しいと思っております。
20
20
 
21
+ ```html
22
+ <div id="slideshow">
23
+ <ul class="bxslider2">
24
+ <li>
25
+ <img src="images/slide_img1.jpg">
26
+ </li>
27
+ <li>
28
+ <img src="images/slide_img2.jpg">
29
+ </li>
30
+ <li>
31
+ <img src="images/slide_img3.jpg">
32
+ </li>
33
+ <li>
34
+ <img src="images/slide_img4.jpg">
35
+ </li>
36
+ <li>
37
+ <img src="images/slide_img5.jpg">
38
+ </li>
39
+ <li>
40
+ <img src="images/slide_img6.jpg">
41
+ </li>
42
+ <li>
43
+ <img src="images/slide_img7.jpg">
44
+ </li>
45
+ <li>
46
+ <img src="images/slide_img8.jpg">
47
+ </li>
48
+ <li>
49
+ <img src="images/slide_img9.jpg">
50
+ </li>
51
+ <li>
52
+ <img src="images/slide_img10.jpg">
53
+ </li>
54
+ <li>
55
+ <img src="images/slide_img11.jpg">
56
+ </li>
57
+ <li>
58
+ <img src="images/slide_img12.jpg">
59
+ </li>
60
+ </ul>
61
+ </div>
62
+ ```
21
63
 
64
+ bxsliderのcssになります。
65
+ ```css
66
+ /**
67
+ * BxSlider v4.1.2 - Fully loaded, responsive content slider
68
+ * http://bxslider.com
69
+ *
70
+ * Written by: Steven Wanderski, 2014
71
+ * http://stevenwanderski.com
72
+ * (while drinking Belgian ales and listening to jazz)
73
+ *
74
+ * CEO and founder of bxCreative, LTD
75
+ * http://bxcreative.com
76
+ */
77
+
78
+
79
+ /** RESET AND LAYOUT
80
+ ===================================*/
81
+
82
+ .bx-wrapper {
83
+ position: relative;
84
+ margin: 0 auto 100px;
85
+ padding: 0;
86
+ *zoom: 1;
87
+ }
88
+
89
+ .bx-wrapper img {
90
+ max-width: 100%;
91
+ display: block;
92
+ }
93
+
94
+ /** THEME
95
+ ===================================*/
96
+
97
+ .bx-wrapper .bx-viewport {
98
+ background: #fff;
99
+
100
+ /*fix other elements on the page moving (on Chrome)*/
101
+ -webkit-transform: translatez(0);
102
+ -moz-transform: translatez(0);
103
+ -ms-transform: translatez(0);
104
+ -o-transform: translatez(0);
105
+ transform: translatez(0);
106
+ }
107
+
108
+ .bx-wrapper .bx-pager,
109
+ .bx-wrapper .bx-controls-auto {
110
+ position: absolute;
111
+ width: 100%;
112
+ }
113
+
114
+ /* LOADER */
115
+
116
+ .bx-wrapper .bx-loading {
117
+ min-height: 50px;
118
+ background: url(images/bx_loader.gif) center center no-repeat #fff;
119
+ height: 100%;
120
+ width: 100%;
121
+ position: absolute;
122
+ top: 0;
123
+ left: 0;
124
+ z-index: 2000;
125
+ }
126
+
127
+ /* PAGER */
128
+
129
+ .bx-wrapper .bx-pager {
130
+ text-align: center;
131
+ font-size: .85em;
132
+ font-family: Arial;
133
+ font-weight: bold;
134
+ color: #666;
135
+ padding-top: 20px;
136
+ }
137
+
138
+ .bx-wrapper .bx-pager .bx-pager-item,
139
+ .bx-wrapper .bx-controls-auto .bx-controls-auto-item {
140
+ display: inline-block;
141
+ *zoom: 1;
142
+ *display: inline;
143
+ }
144
+
145
+ .bx-wrapper .bx-pager.bx-default-pager a {
146
+ background: #666;
147
+ text-indent: -9999px;
148
+ display: block;
149
+ width: 10px;
150
+ height: 10px;
151
+ margin: 0 5px;
152
+ outline: 0;
153
+ -moz-border-radius: 5px;
154
+ -webkit-border-radius: 5px;
155
+ border-radius: 5px;
156
+ }
157
+
158
+ .bx-wrapper .bx-pager.bx-default-pager a:hover,
159
+ .bx-wrapper .bx-pager.bx-default-pager a.active {
160
+ background: #000;
161
+ }
162
+
163
+ /* DIRECTION CONTROLS (NEXT / PREV) */
164
+
165
+ .bx-wrapper .bx-prev {
166
+ left: 10px;
167
+ background: url(images/controls.png) no-repeat 0 -32px;
168
+ }
169
+
170
+ .bx-wrapper .bx-next {
171
+ right: 10px;
172
+ background: url(images/controls.png) no-repeat -43px -32px;
173
+ }
174
+
175
+ .bx-wrapper .bx-prev:hover {
176
+ background-position: 0 0;
177
+ }
178
+
179
+ .bx-wrapper .bx-next:hover {
180
+ background-position: -43px 0;
181
+ }
182
+
183
+ .bx-wrapper .bx-controls-direction a {
184
+ position: absolute;
185
+ top: 50%;
186
+ margin-top: -16px;
187
+ outline: 0;
188
+ width: 32px;
189
+ height: 32px;
190
+ text-indent: -9999px;
191
+ z-index: 9999;
192
+ }
193
+
194
+ .bx-wrapper .bx-controls-direction a.disabled {
195
+ display: none;
196
+ }
197
+
198
+ /* AUTO CONTROLS (START / STOP) */
199
+
200
+ .bx-wrapper .bx-controls-auto {
201
+ text-align: center;
202
+ }
203
+
204
+ .bx-wrapper .bx-controls-auto .bx-start {
205
+ display: block;
206
+ text-indent: -9999px;
207
+ width: 10px;
208
+ height: 11px;
209
+ outline: 0;
210
+ background: url(images/controls.png) -86px -11px no-repeat;
211
+ margin: 0 3px;
212
+ }
213
+
214
+ .bx-wrapper .bx-controls-auto .bx-start:hover,
215
+ .bx-wrapper .bx-controls-auto .bx-start.active {
216
+ background-position: -86px 0;
217
+ }
218
+
219
+ .bx-wrapper .bx-controls-auto .bx-stop {
220
+ display: block;
221
+ text-indent: -9999px;
222
+ width: 9px;
223
+ height: 11px;
224
+ outline: 0;
225
+ background: url(images/controls.png) -86px -44px no-repeat;
226
+ margin: 0 3px;
227
+ }
228
+
229
+ .bx-wrapper .bx-controls-auto .bx-stop:hover,
230
+ .bx-wrapper .bx-controls-auto .bx-stop.active {
231
+ background-position: -86px -33px;
232
+ }
233
+
234
+ /* PAGER WITH AUTO-CONTROLS HYBRID LAYOUT */
235
+
236
+ .bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-pager {
237
+ text-align: left;
238
+ width: 80%;
239
+ }
240
+
241
+ .bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-controls-auto {
242
+ right: 0;
243
+ width: 35px;
244
+ }
245
+
246
+ /* IMAGE CAPTIONS */
247
+
248
+ .bx-wrapper .bx-caption {
249
+ position: absolute;
250
+ bottom: 0;
251
+ left: 0;
252
+ background: #666\9;
253
+ background: rgba(80, 80, 80, 0.75);
254
+ width: 100%;
255
+ }
256
+
257
+ .bx-wrapper .bx-caption span {
258
+ color: #fff;
259
+ font-family: Arial;
260
+ display: block;
261
+ font-size: .85em;
262
+ padding: 10px;
263
+ }
264
+
265
+ ```
266
+
267
+ ```javascript
268
+ <script>
269
+ $(document).ready(function(){
270
+ var huga = $('.bxslider2').bxSlider({
271
+ infiniteLoop: true,
272
+ controls: false,
273
+ swipeThreshold: 70,
274
+ auto: true,
275
+ pause: 3000,
276
+ onSlideAfter: function(){
277
+ huga.startAuto();
278
+ }
279
+ });
280
+ });
281
+ </script>
282
+ <script>
283
+ ```
284
+
285
+
22
286
  解決策を知っている方宜しくお願い致します。