[英]Disable the scrolling to the top of a page before opening a sidebar
When I open a sidebar, how do I disable the scrolling to the top of the page before opening? 打开侧栏时,如何在打开前禁用滚动到页面顶部的功能?
I want to be able to have the page stay at the same position of the window when opening the sidebar! 我希望能够在打开侧栏时使页面停留在窗口的相同位置!
If you use position: fixed
and top: 0
left: 0
then it will stay in the same position on the page. 如果您使用
position: fixed
和top: 0
left: 0
那么它将停留在页面上的相同位置。
Check out this fiddle: http://jsfiddle.net/mu995/ 看看这个小提琴: http : //jsfiddle.net/mu995/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.