A unique code snippet that I have positions a button fixed to the top of the page, causing it to overlay content or images as the user scrolls the page.
HTML
<div id="btn">button</div>
... images ...
... content ...
CSS
#btn {
position: fixed;
z-index: 999;
color: #fff;
top: 0; right: 0;
}
I am looking for a way to trigger a change in the CSS of the #btn element when it reaches a specific point on the page, like an 'anchor'.
So essentially, when the button hits this anchor point:
<div id="btn">button</div>
... images ...
anchor changing the css
... content ...
Note: The distance between my button and the content or images is not known or controlled by me.