I am looking to add a floating button that remains in the same position relative to the content until the window is scrolled to a certain point, after which it sticks to the end of the content.
In simple terms, I want the element to act as 'relative' until it reaches a specific position, and then change its behavior to 'fixed'.
I am exploring CSS solutions for achieving this effect. If not possible with stylesheets, I will consider a JavaScript solution.
Desired Outcome:
When the content block is above the specified position:
https://i.stack.imgur.com/rWlnq.png
And when it gets to the end so the initial position is below its bottom edge: