Prevent page scrolling to top upon adding fixed position

后端 未结 2 1324
野的像风
野的像风 2021-02-04 03:13

I\'m facing a problem where the page is scrolling to the top whenever I add my .noscroll class to the body. This way the scrollbar is still visible but greyed out w

2条回答
  •  醉酒成梦
    2021-02-04 03:44

    Taking a quick look at how facebook does it, it's something like this:

    
      

    Sorry for the inline styles. You need to programmatically set the main div's top style to your scroll position.

提交回复
热议问题