Hi Michael.
If I've correctly understood the type of thing you wanted initially, I think it can be achieved in SD5 using Intersection Observer.
The attached specimen is created in SD5 build 3490 using Frameworkless. I'm not sure that it will open in earlier versions, but if it doesn't, you will see how I did it by examining the code of the exported project which I've also attached.
I've done this just to demonstrate the principles involved, and that your suggestion is by no means impractical. I guess you will be able to deal with the application of those principles to whatever your project is - I have no web design talent. The main things to look at are the JavaScript in the footer, and the little cup icon with the id "marker" which triggers the change when it goes off the screen or comes back on the screen.
Even if you decide not to use it, at least it appears that the answer to the question in your first post about whether it can be done in SD is "Yes".
Frank