开发者

Div's margin-top stays 20px when scrolling

开发者 https://www.devze.com 2023-04-06 09:13 出处:网络
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.开发者_P

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消