简体   繁体   English

禁用背景滚动

[英]Disable Background Scrolling

I am having a asp:LinkButton to show a div on click. 我有一个asp:LinkBut​​ton在单击时显示一个div。 On showing the div I want to disable the background page(aspx page) from scrolling. 在显示div时,我想禁用滚动背景页(aspx页)。 How to do that? 怎么做? I have appplied overflow:hidden; 我已经申请了overflow:hidden; css property to the body. css属性为正文。 It works fine in the browser but not in mobile devices such as samsung galaxy tablet version-2.2 and sony ericssion version 4.0.4.I want to disable the page scrolling when my application is viewed in mobile. 它在浏览器中工作正常,但在移动设备(如三星银河平板电脑2.2版和索尼爱立信4.0.4版)中不能正常工作。我想在移动设备上查看应用程序时禁用页面滚动。

Please help. 请帮忙。 Any help will be appreciated. 任何帮助将不胜感激。 Thanks in Advance. 提前致谢。

Set overflow:scroll; 设置溢出:滚动; on the body AND the HTML. 在正文和HTML上。 Also set the position to fixed, position:fixed;. 还要将位置设置为fixed,position:fixed;。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM