Closed tenkirin closed 5 days ago
Hey, glad you found it useful! Good point, I noticed that too, but other than playing around with the trigger margins, I have no good solution.
Good point about the contacting too. I'm going to start a complete rewrite of this site (which I wny I only saw this message now, I never looked here, sorry!) and I'll make sure my e-mail/social media links are features more prominently!
This post really helped me and I want to say thanks to you. Didn't found any other places to leave a message or send you an email so I have to open an issue for this purpose, hope you don't mind it(if so, I am sorry for this and maybe you could delete this issue).
I leart a lot from the article, and am going to read more on your blog.
And there are a few points I'd like to mention:
About updating reading position using the Intersection Observer API, it's still sort of imperfect.
Consider this situation: first, user scrolled the page up and a certain title(called 'A') passed/intersected the line set by
rootMargin
thus got active, then user scrolls the page down to read previous contents ahead of this title A. At this time, if the title A moves below the line again, it means that current content that user is reading belongs to the previous title(called B), i.e. the previous title B ought to be active. But actually it won't as the previous title B didn't intersect the line at all.For instance, just in this post, there is a long gap between
Example
andUsing the data
. In the reading order,Example
got active thenUsing the data
. If you scroll the page down to review the contents ofExample
and stop at 'The resultingtableOfContents
object would look like:', at this point, the contents you are focusing on is aboutExmaple
but the active one isUsing the data
asExample
have no chance to interset the line yet.Maybe you could consider integrating a GitHub based comments system into your blog so that readers like me are able to communicate with you more conveniently. I recommend this one as it utilizes the GitHub Discussions feature thus won't pollute the issue.