I have a div element that I want to move with the page for when you scroll it, such as in the picture below. but right now it’s just sitting in a fixed position. How can I accomplish this?
I know I need to use JS, can someone point me in the right direction ?

<div id='slider'>
</div>
There is no need for JS you should use position fixed