I have a website with a sidebar that is longer than one browser 'screen'. I am looking for a solution where:
- as we scroll down the page, the sidebar also scrolls as if it were in a static position
- when the bottom of the screen reaches the bottom of the sidebar, it starts to stick and drag along (sidebar's position fixed to the bottom)
- after dragging it for some time, when scrolling up, it should again scroll like a static position
- when the top of the screen reaches the top of the sidebar, it should start to move up with us until it returns to its starting point and remains fixed at the top
I've searched for solutions and tried using jQuery, but nothing has worked for me. Any suggestions on what else I could use?
Link: