質問編集履歴
2
マルチポストについて追記しております
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
|
3
|
+
<こちらでもマルチポストさせていただいております>
|
4
|
+
https://ja.stackoverflow.com/questions/73542/%e3%82%b9%e3%82%af%e3%83%ad%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e3%81%a8-%e3%81%b5%e3%82%8f%e3%81%a3%e3%81%a8-%e3%82%b9%e3%82%af%e3%83%ad%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e3%82%a2%e3%83%8b%e3%83%a1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3-%e3%81%ae%e5%ae%9f%e8%a3%85%e3%81%8c%e3%81%a7%e3%81%8d%e3%81%be%e3%81%9b%e3%82%93
|
5
|
+
|
3
6
|
LPを制作しています。初心者です。
|
4
7
|
|
5
8
|
【スクロールすると「ふわっと」スクロールするアニメーション】を実装しようとしましたが、
|
1
htmlのhead部分を追記しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -21,7 +21,28 @@
|
|
21
21
|
```
|
22
22
|
【HTML】
|
23
23
|
ソースコード:
|
24
|
+
<!DOCTYPE html>
|
25
|
+
<html lang="ja">
|
26
|
+
<head>
|
27
|
+
<meta charset="UTF-8">
|
28
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
29
|
+
<title>Document</title>
|
30
|
+
<link rel="stylesheet" href="css/style.css">
|
31
|
+
<link rel="stylesheet" type="text/css" href="css/slick.css" media="screen" />
|
32
|
+
<link rel="stylesheet" type="text/css" href="css/slick-theme.css" media="screen" />
|
33
|
+
<link rel="preconnect" href="https://fonts.gstatic.com">
|
34
|
+
<link href="https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@300&display=swap" rel="stylesheet">
|
35
|
+
<link rel="preconnect" href="https://fonts.gstatic.com">
|
36
|
+
<link href="https://fonts.googleapis.com/css2?family=Sawarabi+Gothic&display=swap" rel="stylesheet">
|
37
|
+
<script type="text/javascript"></script>
|
38
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
39
|
+
<script src="js/slick.min.js"></script>
|
40
|
+
<script src="js/app.js"></script>
|
41
|
+
|
42
|
+
</head>
|
43
|
+
|
44
|
+
<ul>
|
24
|
-
<li class="fadein
|
45
|
+
<li class="fadein scrollin">
|
25
46
|
テキストが入ります。
|
26
47
|
<p>テキストが入ります。<br><br>
|
27
48
|
テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。
|
@@ -31,6 +52,7 @@
|
|
31
52
|
<figcaption>テキストが入ります。</figcaption>
|
32
53
|
</figure>
|
33
54
|
</li>
|
55
|
+
</ul>
|
34
56
|
|
35
57
|
【CSS】
|
36
58
|
ソースコード:
|
@@ -40,7 +62,7 @@
|
|
40
62
|
transition : all 500ms;
|
41
63
|
}
|
42
64
|
|
43
|
-
.
|
65
|
+
.scrollin {
|
44
66
|
opacity : 1;
|
45
67
|
transform : translate(0, 0);
|
46
68
|
}
|
@@ -54,7 +76,7 @@
|
|
54
76
|
var scroll = $(window).scrollTop();
|
55
77
|
var windowHeight = $(window).height();
|
56
78
|
if (scroll > elemPos - windowHeight + 200){
|
57
|
-
$(this).addClass('.
|
79
|
+
$(this).addClass('.scrollin');
|
58
80
|
}
|
59
81
|
});
|
60
82
|
});
|