回答編集履歴
1
capture と passive の追加
test
CHANGED
@@ -44,7 +44,13 @@
|
|
44
44
|
|
45
45
|
};
|
46
46
|
|
47
|
-
window.addEventListener("scroll", scrollAction
|
47
|
+
window.addEventListener("scroll", scrollAction, {
|
48
|
+
|
49
|
+
capture: false,
|
50
|
+
|
51
|
+
passive: true,
|
52
|
+
|
53
|
+
}); // 4.
|
48
54
|
|
49
55
|
scrollAction(); // 初期描画時に一度だけ判定する
|
50
56
|
|