質問編集履歴
3
質問内容の本文を変更しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,6 +8,34 @@
|
|
8
8
|
|
9
9
|
|
10
10
|
|
11
|
+
$(function() {
|
12
|
+
|
13
|
+
$(".sidebarIconToggle").click(function() {
|
14
|
+
|
15
|
+
$(".wrapper_gray").fadeIn(); /*ふわっと表示*/
|
16
|
+
|
17
|
+
});
|
18
|
+
|
19
|
+
$(".sidebarIconToggle").click(function() {
|
20
|
+
|
21
|
+
$(".wrapper_gray").fadeOut(); /*ふわっと消える*/
|
22
|
+
|
23
|
+
});
|
24
|
+
|
25
|
+
});
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
ですと一回クリックした時にすでにオーバーレイは時間差でfade outしてしまいます。
|
30
|
+
|
31
|
+
これを「再びクリックした時」に変更したいです。
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
どうぞよろしくお願いします。
|
36
|
+
|
37
|
+
|
38
|
+
|
11
39
|
##html
|
12
40
|
|
13
41
|
```html
|
2
htmlを書き加え、cssを変更し Jsを書き加えました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,6 +14,8 @@
|
|
14
14
|
|
15
15
|
<main class="wrapper">
|
16
16
|
|
17
|
+
<div class="wrapper_gray"></div>
|
18
|
+
|
17
19
|
|
18
20
|
|
19
21
|
中略
|
@@ -42,238 +44,250 @@
|
|
42
44
|
|
43
45
|
.wrapper_gray{
|
44
46
|
|
47
|
+
display: none;
|
48
|
+
|
45
|
-
|
49
|
+
width: 100%;
|
46
|
-
|
50
|
+
|
47
|
-
|
51
|
+
height: 100%;
|
52
|
+
|
48
|
-
|
53
|
+
position: fixed;
|
54
|
+
|
55
|
+
overflow: scroll;
|
56
|
+
|
57
|
+
top: 0;
|
58
|
+
|
59
|
+
left: 0;
|
60
|
+
|
61
|
+
z-index: 1;
|
62
|
+
|
49
|
-
|
63
|
+
background: rgba(0,0,0,0.5);
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
}
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
/*ハンバーガーボタン*/
|
72
|
+
|
73
|
+
.c-button {
|
74
|
+
|
75
|
+
position: relative;
|
76
|
+
|
77
|
+
display: inline-block;
|
78
|
+
|
79
|
+
text-decoration: none;
|
80
|
+
|
81
|
+
-webkit-appearance: none;
|
82
|
+
|
83
|
+
-moz-appearance: none;
|
84
|
+
|
85
|
+
appearance: none;
|
86
|
+
|
87
|
+
border: none;
|
88
|
+
|
89
|
+
background-color: transparent;
|
90
|
+
|
91
|
+
cursor: pointer;
|
92
|
+
|
93
|
+
z-index: 100;
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
}
|
98
|
+
|
99
|
+
.c-button:before{
|
100
|
+
|
101
|
+
display: block;
|
102
|
+
|
103
|
+
content: "";
|
104
|
+
|
105
|
+
background-image: url("../images/lang_btn.svg");
|
106
|
+
|
107
|
+
background-repeat: no-repeat;
|
108
|
+
|
109
|
+
width: 27px;
|
110
|
+
|
111
|
+
height: 17px;
|
50
112
|
|
51
113
|
position: absolute;
|
52
114
|
|
115
|
+
margin-top:-9px;
|
116
|
+
|
53
|
-
|
117
|
+
right:88%;
|
54
|
-
|
118
|
+
|
55
|
-
}
|
119
|
+
}
|
56
|
-
|
57
|
-
|
120
|
+
|
58
|
-
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
59
|
-
|
127
|
+
.p-hamburger {
|
60
|
-
|
128
|
+
|
61
|
-
position:
|
129
|
+
position: absolute;
|
130
|
+
|
62
|
-
|
131
|
+
top: 70px;
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
right: 1%;
|
136
|
+
|
137
|
+
width: 92px;
|
138
|
+
|
139
|
+
height: 78px;
|
140
|
+
|
141
|
+
background-color:transparent;
|
142
|
+
|
143
|
+
margin: 0 auto;
|
144
|
+
|
145
|
+
-webkit-transition: all .3s ease-in-out;
|
146
|
+
|
147
|
+
transition: all .3s ease-in-out;
|
148
|
+
|
149
|
+
}
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
.p-hamburger__line {
|
156
|
+
|
157
|
+
position: absolute;
|
158
|
+
|
159
|
+
top: 0;
|
160
|
+
|
161
|
+
right: 0;
|
162
|
+
|
163
|
+
bottom: 0;
|
164
|
+
|
165
|
+
left: 0;
|
166
|
+
|
167
|
+
margin: auto;
|
168
|
+
|
169
|
+
width: 35px;
|
170
|
+
|
171
|
+
height: 3px;
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
background-color: #fff;
|
176
|
+
|
177
|
+
-webkit-transition: inherit;
|
178
|
+
|
179
|
+
transition: inherit;
|
180
|
+
|
181
|
+
}
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
.p-hamburger__line::before,
|
186
|
+
|
187
|
+
.p-hamburger__line::after {
|
188
|
+
|
189
|
+
position: absolute;
|
190
|
+
|
63
|
-
display:
|
191
|
+
display: block;
|
192
|
+
|
64
|
-
|
193
|
+
width: 100%;
|
194
|
+
|
195
|
+
height: 100%;
|
196
|
+
|
65
|
-
|
197
|
+
background-color: inherit;
|
198
|
+
|
66
|
-
|
199
|
+
content: '';
|
200
|
+
|
67
|
-
-webkit-
|
201
|
+
-webkit-transition: inherit;
|
68
|
-
|
69
|
-
|
202
|
+
|
70
|
-
|
71
|
-
|
203
|
+
transition: inherit;
|
204
|
+
|
72
|
-
|
205
|
+
}
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
.p-hamburger__line::before {
|
210
|
+
|
211
|
+
top: -12px;
|
212
|
+
|
213
|
+
}
|
214
|
+
|
215
|
+
.p-hamburger__line::after {
|
216
|
+
|
73
|
-
|
217
|
+
top: 12px;
|
218
|
+
|
219
|
+
}
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
.p-hamburger[aria-expanded="true"] .p-hamburger__line {
|
74
224
|
|
75
225
|
background-color: transparent;
|
76
226
|
|
77
|
-
|
227
|
+
transform: rotateZ(180deg);
|
78
|
-
|
79
|
-
|
228
|
+
|
80
|
-
|
81
|
-
|
82
|
-
|
229
|
+
|
230
|
+
|
83
|
-
}
|
231
|
+
}
|
84
|
-
|
85
|
-
|
232
|
+
|
86
|
-
|
87
|
-
|
233
|
+
|
88
|
-
|
89
|
-
|
234
|
+
|
90
|
-
|
91
|
-
|
235
|
+
.p-hamburger[aria-expanded="true"] .p-hamburger__line::before,
|
236
|
+
|
92
|
-
|
237
|
+
.p-hamburger[aria-expanded="true"] .p-hamburger__line::after {
|
238
|
+
|
239
|
+
top: 0;
|
240
|
+
|
93
|
-
|
241
|
+
background-color: #fff;
|
94
|
-
|
95
|
-
|
242
|
+
|
96
|
-
|
97
|
-
|
243
|
+
|
98
|
-
|
99
|
-
|
244
|
+
|
100
|
-
|
101
|
-
|
245
|
+
|
102
|
-
|
103
|
-
|
246
|
+
|
104
|
-
|
105
|
-
}
|
247
|
+
}
|
248
|
+
|
249
|
+
|
250
|
+
|
106
|
-
|
251
|
+
.p-hamburger[aria-expanded="true"] .p-hamburger__line::before {
|
252
|
+
|
107
|
-
|
253
|
+
-webkit-transform: rotate(45deg);
|
254
|
+
|
108
|
-
|
255
|
+
-ms-transform: rotate(45deg);
|
256
|
+
|
109
|
-
|
257
|
+
transform: rotate(45deg);
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
110
|
-
|
263
|
+
}
|
264
|
+
|
265
|
+
|
266
|
+
|
111
|
-
|
267
|
+
.p-hamburger[aria-expanded="true"] .p-hamburger__line::after {
|
268
|
+
|
112
|
-
|
269
|
+
-webkit-transform: rotate(-45deg);
|
270
|
+
|
271
|
+
-ms-transform: rotate(-45deg);
|
272
|
+
|
273
|
+
transform: rotate(-45deg);
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
}
|
278
|
+
|
113
|
-
.p-hamburger
|
279
|
+
.p-hamburger:focus{
|
280
|
+
|
281
|
+
outline: none;
|
282
|
+
|
283
|
+
}
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
.u-visuallyHidden {
|
114
288
|
|
115
289
|
position: absolute;
|
116
290
|
|
117
|
-
top: 70px;
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
right: 1%;
|
122
|
-
|
123
|
-
width: 92px;
|
124
|
-
|
125
|
-
height: 78px;
|
126
|
-
|
127
|
-
background-color:transparent;
|
128
|
-
|
129
|
-
margin: 0 auto;
|
130
|
-
|
131
|
-
-webkit-transition: all .3s ease-in-out;
|
132
|
-
|
133
|
-
transition: all .3s ease-in-out;
|
134
|
-
|
135
|
-
}
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
.p-hamburger__line {
|
142
|
-
|
143
|
-
position: absolute;
|
144
|
-
|
145
|
-
top: 0;
|
146
|
-
|
147
|
-
right: 0;
|
148
|
-
|
149
|
-
bottom: 0;
|
150
|
-
|
151
|
-
left: 0;
|
152
|
-
|
153
|
-
margin: auto;
|
154
|
-
|
155
|
-
width: 35px;
|
156
|
-
|
157
|
-
height: 3px;
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
background-color: #fff;
|
162
|
-
|
163
|
-
-webkit-transition: inherit;
|
164
|
-
|
165
|
-
transition: inherit;
|
166
|
-
|
167
|
-
}
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
.p-hamburger__line::before,
|
172
|
-
|
173
|
-
.p-hamburger__line::after {
|
174
|
-
|
175
|
-
position: absolute;
|
176
|
-
|
177
|
-
display: block;
|
178
|
-
|
179
|
-
width: 100%;
|
180
|
-
|
181
|
-
height: 100%;
|
182
|
-
|
183
|
-
background-color: inherit;
|
184
|
-
|
185
|
-
content: '';
|
186
|
-
|
187
|
-
-webkit-transition: inherit;
|
188
|
-
|
189
|
-
transition: inherit;
|
190
|
-
|
191
|
-
}
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
.p-hamburger__line::before {
|
196
|
-
|
197
|
-
top: -12px;
|
198
|
-
|
199
|
-
}
|
200
|
-
|
201
|
-
.p-hamburger__line::after {
|
202
|
-
|
203
|
-
top: 12px;
|
204
|
-
|
205
|
-
}
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
.p-hamburger[aria-expanded="true"] .p-hamburger__line {
|
210
|
-
|
211
|
-
background-color: transparent;
|
212
|
-
|
213
|
-
transform: rotateZ(180deg);
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
}
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
.p-hamburger[aria-expanded="true"] .p-hamburger__line::before,
|
222
|
-
|
223
|
-
.p-hamburger[aria-expanded="true"] .p-hamburger__line::after {
|
224
|
-
|
225
|
-
top: 0;
|
226
|
-
|
227
|
-
background-color: #fff;
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
}
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
.p-hamburger[aria-expanded="true"] .p-hamburger__line::before {
|
238
|
-
|
239
|
-
-webkit-transform: rotate(45deg);
|
240
|
-
|
241
|
-
-ms-transform: rotate(45deg);
|
242
|
-
|
243
|
-
transform: rotate(45deg);
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
}
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
.p-hamburger[aria-expanded="true"] .p-hamburger__line::after {
|
254
|
-
|
255
|
-
-webkit-transform: rotate(-45deg);
|
256
|
-
|
257
|
-
-ms-transform: rotate(-45deg);
|
258
|
-
|
259
|
-
transform: rotate(-45deg);
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
}
|
264
|
-
|
265
|
-
.p-hamburger:focus{
|
266
|
-
|
267
|
-
outline: none;
|
268
|
-
|
269
|
-
}
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
.u-visuallyHidden {
|
274
|
-
|
275
|
-
position: absolute;
|
276
|
-
|
277
291
|
white-space: nowrap;
|
278
292
|
|
279
293
|
width: 1px;
|
@@ -458,4 +472,20 @@
|
|
458
472
|
|
459
473
|
});
|
460
474
|
|
475
|
+
$(function() {
|
476
|
+
|
477
|
+
$(".sidebarIconToggle").click(function() {
|
478
|
+
|
479
|
+
$(".wrapper_gray").fadeIn(); /*ふわっと表示*/
|
480
|
+
|
481
|
+
});
|
482
|
+
|
483
|
+
$(".sidebarIconToggle").click(function() {
|
484
|
+
|
485
|
+
$(".wrapper_gray").fadeOut(); /*ふわっと消える*/
|
486
|
+
|
487
|
+
});
|
488
|
+
|
489
|
+
});
|
490
|
+
|
461
491
|
```
|
1
質問内容を「意図した結果とならず、解決方法をご相談したいです。」と変更しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
ハンバーガーメニューをクリックしてドロワーメニューが出現すると、ドロワーメニューより下の背景全体(.wrapper)を暗くしたい。という目的があり、取り組んでいます。
|
6
6
|
|
7
|
-
|
7
|
+
意図した結果とならず、解決方法をご相談したいです。
|
8
8
|
|
9
9
|
|
10
10
|
|