Sticky Buttons Within A Section

Common practices for sticking elements weren’t working for me: position: sticky and stickybits. I didn’t want to use jQuery either, normally I’d reach to use waypoints.inview. So I wrote my own in vanilla Javascript.

The nice part is it was much easier to do a sticky bottom. Scroll to element, bottom of viewport hits bottom of to-be-stuck element, and carries it down until the end of its parent element.

This is a great feature for section-specific call to actions.

Leave a Reply

Your email address will not be published. Required fields are marked *