回答編集履歴

1

サンプルリンクの追加

2022/08/27 16:09

投稿

hatena19
hatena19

スコア34367

test CHANGED
@@ -49,6 +49,7 @@
49
49
  });
50
50
  }
51
51
  ```
52
+ [CodePenサンプル](https://codepen.io/hatena19/pen/ZExdpaj)
52
53
 
53
54
  ウィンドウのスクロール位置は、
54
55
  jQueryなら`$(window).scrollTop()`
@@ -60,3 +61,8 @@
60
61
 
61
62
  [Document.querySelector() - Web API | MDN](https://developer.mozilla.org/ja/docs/Web/API/Document/querySelector)
62
63
 
64
+ イベントの付与はaddEventListenerで。
65
+ [EventTarget.addEventListener() - Web API | MDN](https://developer.mozilla.org/ja/docs/Web/API/EventTarget/addEventListener)
66
+
67
+ ↓生JSのサンプルコード
68
+ [CodePenサンプル](https://codepen.io/hatena19/pen/zYWVKMX)