Theo's Typesafe CultTTC
Theo's Typesafe Cult4y ago
113 replies
julius

Intersection Observers

Can someone tell me what I'm doing wrong here?

I'm trying to get this IntersectinoObserver to update other elements than the one actually being observed, when the heading is scrolled into view, i want the corresponding element in the TOC to update and change some styles on it, but i can only get the observed element to change. is this some perf thing that wont let you do this? Source: https://github.com/t3-oss/create-t3-app/blob/38fd589c3c43e21eef19ec177e78192884b79d9e/www/src/components/navigation/tableOfContents.astro

Demo: https://share.cleanshot.com/xddfsF
GitHub
Quickest way to start a new web app with full stack typesafety - create-t3-app/tableOfContents.astro at 38fd589c3c43e21eef19ec177e78192884b79d9e · t3-oss/create-t3-app
create-t3-app/tableOfContents.astro at 38fd589c3c43e21eef19ec177e78...
CleanShot Cloud
GIF uploaded to CleanShot Cloud
CleanShot 2022-09-18 at 20.10.45
Was this page helpful?