position: sticky events
IntersectionObserver
を使うことで、scrollイベントを使わずにsticky headerを実現するデモ
https://developers.google.com/web/updates/2017/09/sticky-headers
position: sticky events
何が嬉しいのか
css
の
position:sticky
では足りていないイベントが発火できる
stickyになった時とか