質問編集履歴
1
HTML、jQueryのコード追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,7 +22,51 @@
|
|
22
22
|
|
23
23
|
HTML
|
24
24
|
|
25
|
+
``` <header id="home">
|
26
|
+
|
27
|
+
<div class="container">
|
28
|
+
|
29
|
+
<div class="header-menu">
|
30
|
+
|
31
|
+
<div class="header-left">
|
32
|
+
|
33
|
+
<h1>Hiroto Morita</h1>
|
34
|
+
|
35
|
+
<!-- <i class="fas fa-bars fa-lg menu-icon"></i> -->
|
36
|
+
|
37
|
+
<div class="hamburger">
|
38
|
+
|
39
|
+
<span></span>
|
40
|
+
|
41
|
+
<span></span>
|
42
|
+
|
43
|
+
<span></span>
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
47
|
+
</div>
|
48
|
+
|
49
|
+
<nav class="header-right">
|
50
|
+
|
51
|
+
<ul class="nav-list">
|
52
|
+
|
53
|
+
<li><a href="#home">Home</a></li>
|
54
|
+
|
55
|
+
<li><a href="#about">About</a></li>
|
56
|
+
|
57
|
+
<li><a href="#service">Service</a></li>
|
58
|
+
|
59
|
+
<li><a href="#contact">Contact</a></li>
|
60
|
+
|
25
|
-
|
61
|
+
</ul>
|
62
|
+
|
63
|
+
</nav>
|
64
|
+
|
65
|
+
</div>
|
66
|
+
|
67
|
+
</div>
|
68
|
+
|
69
|
+
</header>
|
26
70
|
|
27
71
|
コード
|
28
72
|
|
@@ -212,7 +256,37 @@
|
|
212
256
|
|
213
257
|
jQuery
|
214
258
|
|
259
|
+
```$(function () {
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
$(window).scroll(function () {
|
264
|
+
|
265
|
+
$(".slide").each(function () {
|
266
|
+
|
267
|
+
var imgPos = $(this).offset().top;
|
268
|
+
|
269
|
+
var scroll = $(window).scrollTop();
|
270
|
+
|
271
|
+
var windowHeight = $(window).height();
|
272
|
+
|
273
|
+
if (scroll > imgPos - windowHeight + windowHeight / 4) {
|
274
|
+
|
275
|
+
$(this).addClass("effect-scroll");
|
276
|
+
|
277
|
+
}
|
278
|
+
|
279
|
+
});
|
280
|
+
|
281
|
+
});
|
282
|
+
|
283
|
+
jQuery(window).scroll();
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
/* ハンバーガーメニュー */
|
288
|
+
|
215
|
-
|
289
|
+
$('.hamburger').click(function () {
|
216
290
|
|
217
291
|
$(this).toggleClass('active');
|
218
292
|
|
@@ -230,6 +304,8 @@
|
|
230
304
|
|
231
305
|
});
|
232
306
|
|
307
|
+
});
|
308
|
+
|
233
309
|
コード
|
234
310
|
|
235
311
|
```
|