引导:如何禁用垂直滚动条?

时间:2022-06-02 20:32:01

when my modal popup window opens, it adds a vertical scrollbar to the right of the browser window. How do i disable this? I think this is enabled when the modal window has a very large height value where it needs to scroll. i want to disable this as my form height does not exceed the window height.

当我的模态弹出窗口打开时,它会在浏览器窗口的右边添加一个垂直的滚动条。如何禁用这个?我认为这是在模式窗口有一个很大的高度值需要滚动时启用的。我想禁用这个,因为我的表单高度不超过窗口高度。

4 个解决方案

#1


31  

In your css add :

在你的css中添加:

body {
  overflow-y:hidden;
}

#2


30  

I have the same problem with bootstrap 3.0.0. It seems that .modal class has overflow-y: scroll rule which results in scrollbar always visible.

我对bootstrap 3。0也有同样的问题。看起来。modal类有过流的:滚动规则,导致滚动条总是可见的。

So, you can amend this either locally:

因此,你可以在本地修改它:

<div class="modal" ... style="overflow-y: auto;">
    ...
</div>

or globally:

或在全球范围内:

<style>
.modal {
    overflow-y: auto;
}
</style>

#3


1  

Add style to body as:

为主体添加样式:

body { 
  padding-right: 0px !important;
  overflow-y: hidden !important;
}

#4


0  

If the model window height is not more than normal window height, it doesn't make any sense to display the the scroll bar. Check weather any <div></div> used to fade the background behind the model window has extra height than the viewpoint.

如果模型窗口高度不超过正常窗口高度,则显示滚动条没有任何意义。检查是否有任何

用于在模型窗口后褪色的背景比视点高。

#1


31  

In your css add :

在你的css中添加:

body {
  overflow-y:hidden;
}

#2


30  

I have the same problem with bootstrap 3.0.0. It seems that .modal class has overflow-y: scroll rule which results in scrollbar always visible.

我对bootstrap 3。0也有同样的问题。看起来。modal类有过流的:滚动规则,导致滚动条总是可见的。

So, you can amend this either locally:

因此,你可以在本地修改它:

<div class="modal" ... style="overflow-y: auto;">
    ...
</div>

or globally:

或在全球范围内:

<style>
.modal {
    overflow-y: auto;
}
</style>

#3


1  

Add style to body as:

为主体添加样式:

body { 
  padding-right: 0px !important;
  overflow-y: hidden !important;
}

#4


0  

If the model window height is not more than normal window height, it doesn't make any sense to display the the scroll bar. Check weather any <div></div> used to fade the background behind the model window has extra height than the viewpoint.

如果模型窗口高度不超过正常窗口高度,则显示滚动条没有任何意义。检查是否有任何

用于在模型窗口后褪色的背景比视点高。