質問編集履歴
4
CSSの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -26,102 +26,190 @@
|
|
26
26
|
|
27
27
|
|
28
28
|
|
29
|
+
|
30
|
+
|
29
|
-
###
|
31
|
+
### 該当のソースコード
|
32
|
+
|
33
|
+
|
34
|
+
|
30
|
-
|
35
|
+
```HTML
|
36
|
+
|
31
|
-
|
37
|
+
<header>
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
<a class="menu">
|
42
|
+
|
43
|
+
<span class="menu__line menu__line--top"></span>
|
44
|
+
|
45
|
+
<span class="menu__line menu__line--center"></span>
|
46
|
+
|
47
|
+
<span class="menu__line menu__line--bottom"></span>
|
48
|
+
|
49
|
+
</a>
|
50
|
+
|
51
|
+
<nav class="gnav">
|
52
|
+
|
53
|
+
<div class="gnav__wrap">
|
54
|
+
|
55
|
+
<ul class="gnav__menu">
|
56
|
+
|
57
|
+
<li><a href="#page1">page1</a></li>
|
58
|
+
|
59
|
+
<li><a href="#page2">page2</a></li>
|
60
|
+
|
61
|
+
<li><a href="#page3">page3</a></li>
|
62
|
+
|
63
|
+
</ul>
|
64
|
+
|
65
|
+
</div>
|
66
|
+
|
67
|
+
</nav>
|
68
|
+
|
69
|
+
</header>
|
32
70
|
|
33
71
|
```
|
34
72
|
|
73
|
+
```CSS
|
74
|
+
|
75
|
+
/*menu*/
|
76
|
+
|
77
|
+
.menu{
|
78
|
+
|
79
|
+
height: 20px;
|
80
|
+
|
81
|
+
position: absolute;
|
82
|
+
|
83
|
+
right: 20px;
|
84
|
+
|
85
|
+
top: 20px;
|
86
|
+
|
87
|
+
width: 30px;
|
88
|
+
|
89
|
+
z-index: 99;
|
90
|
+
|
91
|
+
}
|
92
|
+
|
93
|
+
.menu__line{
|
94
|
+
|
95
|
+
background: #fff;
|
96
|
+
|
97
|
+
display: block;
|
98
|
+
|
99
|
+
height: 2px;
|
100
|
+
|
101
|
+
position: absolute;
|
102
|
+
|
103
|
+
transition:transform .3s;
|
104
|
+
|
105
|
+
width: 100%;
|
106
|
+
|
107
|
+
}
|
108
|
+
|
109
|
+
.menu__line--center{
|
110
|
+
|
35
|
-
|
111
|
+
top: 9px;
|
112
|
+
|
113
|
+
}
|
114
|
+
|
115
|
+
.menu__line--bottom{
|
116
|
+
|
117
|
+
bottom: 0;
|
118
|
+
|
119
|
+
}
|
120
|
+
|
121
|
+
.menu__line--top.active{
|
122
|
+
|
123
|
+
top: 8px;
|
124
|
+
|
125
|
+
transform: rotate(45deg);
|
126
|
+
|
127
|
+
}
|
128
|
+
|
129
|
+
.menu__line--center.active{
|
130
|
+
|
131
|
+
transform:scaleX(0);
|
132
|
+
|
133
|
+
}
|
134
|
+
|
135
|
+
.menu__line--bottom.active{
|
136
|
+
|
137
|
+
bottom: 10px;
|
138
|
+
|
139
|
+
transform: rotate(135deg);
|
140
|
+
|
141
|
+
}
|
142
|
+
|
143
|
+
/*gnav*/
|
144
|
+
|
145
|
+
.gnav{
|
146
|
+
|
147
|
+
background: rgba(0,0,0,0.8);
|
148
|
+
|
149
|
+
display: none;
|
150
|
+
|
151
|
+
height: 100%;
|
152
|
+
|
153
|
+
position: fixed;
|
154
|
+
|
155
|
+
width: 100%;
|
156
|
+
|
157
|
+
z-index: 98;
|
158
|
+
|
159
|
+
}
|
160
|
+
|
161
|
+
.gnav__wrap{
|
162
|
+
|
163
|
+
align-items:center;
|
164
|
+
|
165
|
+
display: flex;
|
166
|
+
|
167
|
+
height: 100%;
|
168
|
+
|
169
|
+
justify-content: center;
|
170
|
+
|
171
|
+
position: absolute;
|
172
|
+
|
173
|
+
width: 100%;
|
174
|
+
|
175
|
+
}
|
36
176
|
|
37
177
|
```
|
38
178
|
|
39
|
-
|
40
|
-
|
41
|
-
### 該当のソースコード
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
```
|
179
|
+
```JQuery
|
180
|
+
|
46
|
-
|
181
|
+
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
|
182
|
+
|
183
|
+
|
184
|
+
|
47
|
-
<
|
185
|
+
<script>
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
186
|
+
|
52
|
-
|
53
|
-
|
187
|
+
$('.menu').on('click',function(){
|
54
|
-
|
188
|
+
|
55
|
-
|
189
|
+
$('.menu__line').toggleClass('active');
|
56
|
-
|
57
|
-
|
190
|
+
|
58
|
-
|
59
|
-
|
191
|
+
$('.gnav').fadeToggle();
|
192
|
+
|
60
|
-
|
193
|
+
$('.drawer').drawer('close');
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
$('#nav a').on('click', function() {
|
198
|
+
|
61
|
-
|
199
|
+
$('#nav').toggleClass('active');
|
62
|
-
|
63
|
-
|
200
|
+
|
64
|
-
|
65
|
-
<ul class="gnav__menu">
|
66
|
-
|
67
|
-
|
201
|
+
$(".menu").toggleClass('active');
|
68
|
-
|
202
|
+
|
69
|
-
|
203
|
+
})
|
70
|
-
|
71
|
-
|
204
|
+
|
72
|
-
|
205
|
+
|
206
|
+
|
73
|
-
|
207
|
+
});
|
74
|
-
|
208
|
+
|
75
|
-
|
209
|
+
</script>
|
76
|
-
|
77
|
-
</nav>
|
78
|
-
|
79
|
-
</header>
|
80
210
|
|
81
211
|
```
|
82
212
|
|
83
|
-
```JQuery
|
84
|
-
|
85
|
-
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
<script>
|
90
|
-
|
91
|
-
$('.menu').on('click',function(){
|
92
|
-
|
93
|
-
$('.menu__line').toggleClass('active');
|
94
|
-
|
95
|
-
$('.gnav').fadeToggle();
|
96
|
-
|
97
|
-
$('.drawer').drawer('close');
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
$('#nav a').on('click', function() {
|
102
|
-
|
103
|
-
$('#nav').toggleClass('active');
|
104
|
-
|
105
|
-
$(".menu").toggleClass('active');
|
106
|
-
|
107
|
-
})
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
});
|
112
|
-
|
113
|
-
</script>
|
114
|
-
|
115
|
-
```
|
116
|
-
|
117
|
-
### 試したこと
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
ここに問題に対して試したことを記載してください。
|
122
|
-
|
123
|
-
|
124
|
-
|
125
213
|
### 補足情報(FW/ツールのバージョンなど)
|
126
214
|
|
127
215
|
このサイトを参考にしています。
|
3
誤字
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
2
誤字
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
1
誤字
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
開いたままの
|
1
|
+
開いたままのハンバーガーメニュー(ページ内リンク)を閉じたい
|
test
CHANGED
@@ -80,7 +80,7 @@
|
|
80
80
|
|
81
81
|
```
|
82
82
|
|
83
|
-
```J
|
83
|
+
```JQuery
|
84
84
|
|
85
85
|
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
|
86
86
|
|