bootstrap模式删除滚动条 [英] bootstrap modal removes scroll bar

查看:146
本文介绍了bootstrap模式删除滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在页面中触发模态视图时,它会触发滚动条消失。这是一种恼人的效果,因为当模态移入/消失时,背景页面开始移动。是否可以解决这种影响?

When I trigger a modal view in my page it triggers the scroll bar to disappear. It's an annoying effect because the background page starts moving when the modal moves in / disappears. Is there a cure for that effect?

推荐答案

这是一个功能,类 modal-open 会在您显示模式时添加到HTML 正文,并在您隐藏时删除。

This is a feature, class modal-open gets added to the HTML body when you show the modal, and removed when you hide it.

这使得滚动条消失,因为bootstrap css说

This makes the scrollbar disappear since the bootstrap css says

.modal-open {
    overflow: hidden;
}

您可以通过指定

.modal-open {
    overflow: scroll;
}

你自己的 css。

这篇关于bootstrap模式删除滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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