如何禁用网页中的滚动条? (不是HIDE滚动条) [英] How to DISABLE scrollbar in webpage? (not HIDE scrollbar)

查看:91
本文介绍了如何禁用网页中的滚动条? (不是HIDE滚动条)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用:

$('body,html').css("overflow","hidden");

页面中的滚动条能够完全隐藏。但我希望在某些AJAX事件期间仅禁用滚动条。以后使用:

the scrollbar in the page was able to hide completely. But i want the scroll bar just to be DISABLED during some AJAX event. Later using:

$('body,html')。css( overflow, visible);

我必须在AJAX成功的情况下再次启用全页滚动。

I had to enable scrolling again for full page in my AJAX success.

(就像从滚动条中删除滚动框并禁用滚动箭头),但滚动条仍显示在窗口中。这样可以防止同时改变页面宽度。

(Like removing scrollbox from scorllbar and disabling scrolling arrows) yet still scrollbar appears in th window. This would prevent from change of page width in meantime.

是否有这样做的可能?
需要任何帮助。

Is there any possibilitioes to do so? Any help is appriciated. Thanks in advance.

推荐答案

好的,这是工作代码:

body
{
    position: fixed; 
    overflow-y: scroll;
    width: 100%;
}

我使用它的方式与您想要的相同。

I used it and its the same what you want.

这篇关于如何禁用网页中的滚动条? (不是HIDE滚动条)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆