質問編集履歴

3

cssも追加しました。

2020/07/09 12:46

投稿

sasaki_0000
sasaki_0000

スコア7

test CHANGED
File without changes
test CHANGED
@@ -160,6 +160,338 @@
160
160
 
161
161
  ```scss
162
162
 
163
+ nav {
164
+
165
+ width: 100%;
166
+
167
+ height: 15vh;
168
+
169
+ position: relative;
170
+
171
+ background: #ffffff;
172
+
173
+ z-index: 9999;
174
+
175
+ }
176
+
177
+
178
+
179
+ .drawer {
180
+
181
+ display: flex;
182
+
183
+ flex-direction: row;
184
+
185
+ align-items: center;
186
+
187
+ justify-content: space-between;
188
+
189
+ position: relative;
190
+
191
+ height: 15vh;
192
+
193
+ padding: 0 2em;
194
+
195
+ }
196
+
197
+
198
+
199
+ .navbar_brand {
200
+
201
+ text-align: center;
202
+
203
+ width: 100%;
204
+
205
+
206
+
207
+ img{
208
+
209
+ width: 30vw;
210
+
211
+ margin: 0 0 0 5.5em;
212
+
213
+ }
214
+
215
+ }
216
+
217
+
218
+
219
+ .navbar_toggle {
220
+
221
+ z-index: 100;
222
+
223
+ padding: 2em;
224
+
225
+ }
226
+
227
+
228
+
229
+ .navbar_toggle_icon {
230
+
231
+ position: relative;
232
+
233
+ display: block;
234
+
235
+ height: 2px;
236
+
237
+ width: 40px;
238
+
239
+ padding: 0 1.2em;
240
+
241
+ background: #000000;
242
+
243
+ -webkit-transition: ease .5s;
244
+
245
+ transition: ease .5s;
246
+
247
+
248
+
249
+ &:nth-child(1) {
250
+
251
+ top: 0;
252
+
253
+ }
254
+
255
+
256
+
257
+ &:nth-child(2) {
258
+
259
+ margin: 8px 0;
260
+
261
+ }
262
+
263
+
264
+
265
+ &:nth-child(3) {
266
+
267
+ top: 0;
268
+
269
+ }
270
+
271
+ }
272
+
273
+
274
+
275
+ /*OPEN時の動き*/
276
+
277
+
278
+
279
+ .navbar_toggle.open .navbar_toggle_icon {
280
+
281
+ &:nth-child(1) {
282
+
283
+ top: 10px;
284
+
285
+ -webkit-transform: rotate(45deg);
286
+
287
+ transform: rotate(45deg);
288
+
289
+ }
290
+
291
+
292
+
293
+ &:nth-child(2) {
294
+
295
+ -webkit-transform: translateY(-50%);
296
+
297
+ transform: translateY(-50%);
298
+
299
+ opacity: 0;
300
+
301
+ }
302
+
303
+
304
+
305
+ &:nth-child(3) {
306
+
307
+ top: -10px;
308
+
309
+ -webkit-transform: rotate(-45deg);
310
+
311
+ transform: rotate(-45deg);
312
+
313
+ }
314
+
315
+ }
316
+
317
+
318
+
319
+ .menu-sp {
320
+
321
+ -webkit-transform: translateX(-100%);
322
+
323
+ transform: translateX(-100%);
324
+
325
+ -webkit-transition: ease .5s;
326
+
327
+ transition: ease .5s;
328
+
329
+ background-color: #ff6347;
330
+
331
+ height: 100vh;
332
+
333
+
334
+
335
+ ul {
336
+
337
+ width: 80%;
338
+
339
+ margin: 0 auto;
340
+
341
+ padding: 3em 0;
342
+
343
+
344
+
345
+ li {
346
+
347
+ padding: 1em 0;
348
+
349
+ width: 100%;
350
+
351
+
352
+
353
+ a {
354
+
355
+ color: white;
356
+
357
+ text-decoration: none;
358
+
359
+ font-size: 1.3em;
360
+
361
+ }
362
+
363
+
364
+
365
+ .child-menu{
366
+
367
+ padding: 1em 0;
368
+
369
+ margin: 0 0 0 2em;
370
+
371
+
372
+
373
+ li{
374
+
375
+ padding: 0.5em 0;
376
+
377
+ width: 100%;
378
+
379
+
380
+
381
+ a{
382
+
383
+ color: white;
384
+
385
+ text-decoration: none;
386
+
387
+ font-size: 1.1em;
388
+
389
+ }
390
+
391
+ }
392
+
393
+ }
394
+
395
+ }
396
+
397
+ }
398
+
399
+
400
+
401
+ &.open {
402
+
403
+ -webkit-transform: translateX(0);
404
+
405
+ transform: translateX(0);
406
+
407
+ overflow-y: auto;
408
+
409
+ -webkit-overflow-scrolling: touch;
410
+
411
+ height: 100vh;
412
+
413
+ }
414
+
415
+ }
416
+
417
+
418
+
419
+ /*OPEN時の動き*/
420
+
421
+
422
+
423
+ @media screen and (min-width: 992px) {
424
+
425
+ nav {
426
+
427
+ display: flex;
428
+
429
+ flex-direction: row;
430
+
431
+ }
432
+
433
+
434
+
435
+ .navbar_toggle {
436
+
437
+ display: none;
438
+
439
+ }
440
+
441
+
442
+
443
+ .menu-sp {
444
+
445
+ width: 100%;
446
+
447
+ -webkit-transform: translateX(0);
448
+
449
+ transform: translateX(0);
450
+
451
+
452
+
453
+ ul {
454
+
455
+ height: 70px;
456
+
457
+ display: flex;
458
+
459
+ flex-wrap: wrap;
460
+
461
+ justify-content: flex-end;
462
+
463
+ align-items: center;
464
+
465
+
466
+
467
+ li {
468
+
469
+ padding: 0 1em;
470
+
471
+ border-bottom: none;
472
+
473
+ }
474
+
475
+ }
476
+
477
+ }
478
+
479
+ }
480
+
481
+
482
+
483
+ .tel-menu-sp{
484
+
485
+ background-color: #ffffff;
486
+
487
+ padding: 2em;
488
+
489
+ width: 80%;
490
+
491
+ margin: 0 auto 3em auto;
492
+
493
+ }
494
+
163
495
 
164
496
 
165
497
  ```

2

htmlの追加

2020/07/09 12:46

投稿

sasaki_0000
sasaki_0000

スコア7

test CHANGED
File without changes
test CHANGED
@@ -40,6 +40,132 @@
40
40
 
41
41
 
42
42
 
43
+ ```html
44
+
45
+ <header class="d-block d-lg-none l-header menu-bg">
46
+
47
+ <nav>
48
+
49
+ <div class="drawer">
50
+
51
+ <a class="navbar_brand" href="<?php echo esc_url( home_url('') ); ?>"><img src="<?php bloginfo('template_directory'); ?>/assets/common/images/common/logo.svg" alt=""></a>
52
+
53
+ <div class="navbar_toggle">
54
+
55
+ <span class="navbar_toggle_icon"></span>
56
+
57
+ <span class="navbar_toggle_icon"></span>
58
+
59
+ <span class="navbar_toggle_icon"></span>
60
+
61
+ </div>
62
+
63
+ </div>
64
+
65
+ <div class="menu-sp">
66
+
67
+ <ul>
68
+
69
+ <li><a href="#"><strong>SAMPLE</strong></a></li>
70
+
71
+ <li><a href="#"><strong>SAMPLE</strong></a></li>
72
+
73
+ <li><a href="#"><strong>SAMPLE</strong></a></li>
74
+
75
+ <li>
76
+
77
+ <a href="#"><strong>SAMPLE</strong></a>
78
+
79
+ <ul class="child-menu">
80
+
81
+ <li><a href="#">SAMPLE</a></li>
82
+
83
+ </ul>
84
+
85
+ </li>
86
+
87
+ <li>
88
+
89
+ <a href="#"><strong>SAMPLE</strong></a>
90
+
91
+ <ul class="child-menu">
92
+
93
+ <li><a href="#">SAMPLE</a></li>
94
+
95
+ </ul>
96
+
97
+ </li>
98
+
99
+ <li>
100
+
101
+ <a href="#"><strong>SAMPLE</strong></a>
102
+
103
+ <ul class="child-menu">
104
+
105
+ <li><a href="#">SAMPLE</a></li>
106
+
107
+ <li><a href="#">SAMPLE</a></li>
108
+
109
+ </ul>
110
+
111
+ </li>
112
+
113
+ <li>
114
+
115
+ <a href="#"><strong>SAMPLE</strong></a>
116
+
117
+ <ul class="child-menu">
118
+
119
+ <li><a href="#">SAMPLE</a></li>
120
+
121
+ </ul>
122
+
123
+ </li>
124
+
125
+ </ul>
126
+
127
+ <div>
128
+
129
+ <ul class="btn-li-sp">
130
+
131
+ <li>
132
+
133
+ <a href="#" class="button-sp mr-3"><i class="far fa-envelope fa-lg fa-fw"></i> Request document</a>
134
+
135
+ </li>
136
+
137
+ </ul>
138
+
139
+ </div>
140
+
141
+ <div class="tel-menu-sp">
142
+
143
+ <img src="<?php bloginfo('template_directory'); ?>/assets/common/images/common/tel-en.svg" class="w100">
144
+
145
+ </div>
146
+
147
+ </div>
148
+
149
+ </div>
150
+
151
+ </nav>
152
+
153
+ <?php wp_head(); ?>
154
+
155
+ </header>
156
+
157
+ ```
158
+
159
+
160
+
161
+ ```scss
162
+
163
+
164
+
165
+ ```
166
+
167
+
168
+
43
169
  ### 試したこと
44
170
 
45
171
 

1

2020/07/09 12:43

投稿

sasaki_0000
sasaki_0000

スコア7

test CHANGED
@@ -1 +1 @@
1
- sqriptで追加したクラスをもう一度クリックした時に削除したいです。
1
+ scriptで追加したクラスをもう一度クリックした時に削除したいです。
test CHANGED
File without changes