質問編集履歴

1

コードの追記

2019/10/17 08:02

投稿

us_k
us_k

スコア6

test CHANGED
File without changes
test CHANGED
@@ -32,6 +32,32 @@
32
32
 
33
33
  ```html
34
34
 
35
+ <!DOCTYPE html>
36
+
37
+ <html lang="ja">
38
+
39
+ <head>
40
+
41
+ <meta charset="UTF-8">
42
+
43
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
44
+
45
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
46
+
47
+ <title>Inn the Park</title>
48
+
49
+ <link rel="stylesheet" href="/style2.css">
50
+
51
+ <link rel="stylesheet" href="/slick/slick.css">
52
+
53
+ <link rel="stylesheet" href="/slick/slick-theme.css">
54
+
55
+ </head>
56
+
57
+ <body>
58
+
59
+
60
+
35
61
  <div class="content-wrapper">
36
62
 
37
63
  <div class="slider">
@@ -62,6 +88,18 @@
62
88
 
63
89
  </div>
64
90
 
91
+
92
+
93
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
94
+
95
+ <script src="/slick/slick.js"></script>
96
+
97
+ <script src="/js/script.js"></script>
98
+
99
+ </body>
100
+
101
+ </html>
102
+
65
103
  ```
66
104
 
67
105
 
@@ -98,8 +136,198 @@
98
136
 
99
137
  }
100
138
 
139
+
140
+
141
+ /*以下補足*/
142
+
143
+
144
+
145
+ * {
146
+
147
+ padding: 0;
148
+
149
+ margin: 0;
150
+
151
+ }
152
+
153
+
154
+
155
+ body {
156
+
157
+ width: 100%;
158
+
159
+ height: 100%;
160
+
161
+ overflow-x: hidden;
162
+
163
+ background-color: #f7f7f7;
164
+
165
+ }
166
+
167
+
168
+
169
+ html {
170
+
171
+ width: 100%;
172
+
173
+ height: 100%;
174
+
175
+ }
176
+
177
+
178
+
179
+ .video-wrapper {
180
+
181
+ width: 40%;
182
+
183
+ height: auto;
184
+
185
+ position: relative;
186
+
187
+ display: inline-block;
188
+
189
+ }
190
+
191
+
192
+
193
+ .video-wrapper:hover {
194
+
195
+ cursor: none;
196
+
197
+ }
198
+
199
+
200
+
201
+ .video-wrapper::before {
202
+
203
+ content: "";
204
+
205
+ display: block;
206
+
207
+ height: auto;
208
+
209
+ padding-top: calc(803 / 1440 *100%);
210
+
211
+ }
212
+
213
+
214
+
215
+ .video-wrapper #video-banner {
216
+
217
+ position: absolute;
218
+
219
+ top: 10px;
220
+
221
+ left: 10px;
222
+
223
+ background-color: rgba(0, 0, 0, 0.5);
224
+
225
+ color: white;
226
+
227
+ padding: 5px 20px;
228
+
229
+ border: 1px solid rgba(255, 255, 255, 0.5);
230
+
231
+ border-radius: 30px;
232
+
233
+ }
234
+
235
+
236
+
237
+ .video-wrapper video {
238
+
239
+ position: absolute;
240
+
241
+ top: 0;
242
+
243
+ left: 0;
244
+
245
+ height: auto;
246
+
247
+ width: 100%;
248
+
249
+ z-index: -100;
250
+
251
+ }
252
+
253
+
254
+
255
+ .content-wrapper {
256
+
257
+ display: -webkit-box;
258
+
259
+ display: -ms-flexbox;
260
+
261
+ display: flex;
262
+
263
+ -webkit-box-pack: center;
264
+
265
+ -ms-flex-pack: center;
266
+
267
+ justify-content: center;
268
+
269
+ -webkit-box-align: center;
270
+
271
+ -ms-flex-align: center;
272
+
273
+ align-items: center;
274
+
275
+ -ms-flex-pack: distribute;
276
+
277
+ justify-content: space-around;
278
+
279
+ height: 100%;
280
+
281
+ }
282
+
101
283
  ```
102
284
 
103
285
 
104
286
 
287
+ ```js
288
+
289
+ $(function(){
290
+
291
+
292
+
293
+ var $video = $('.video-wrapper');
294
+
105
- 該当すると思われる箇所のコードを記載しました。他の箇所のコードの影響が考えられる場合は追記いたします。
295
+ $video.on('mouseenter', function(){
296
+
297
+ $('video').get(0).play();
298
+
299
+ $('#video-banner').css('display', 'none');
300
+
301
+ });
302
+
303
+ $video.on('mouseout', function(){
304
+
305
+ $('video').get(0).pause();
306
+
307
+ $('#video-banner').css('display', 'block');
308
+
309
+ });
310
+
311
+
312
+
313
+ $(".slider").slick({
314
+
315
+ dots: false,
316
+
317
+ vertical: false,
318
+
319
+ slidesToShow: 1,
320
+
321
+ slidesToScroll: 1,
322
+
323
+ });
324
+
325
+
326
+
327
+ });
328
+
329
+ ```
330
+
331
+
332
+
333
+ 状態が再現できるコードを追記いたしました。