Div's margin-top stays 20px when scrolling
I want the div on the right side of this page to stop scrolling up when you scroll down the page. So that it is always 20px from the top of the window and the customer can read it's contents.开发者_Python百科
How can I achieve that? CSS? jQuery?
Thanks
jQuery. Do an on scroll event, and when scroll height gets past a certain point, make the div position:fixed.
精彩评论