引导模式删除滚动条

引导模式删除滚动条

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

问题描述

当我在页面中触发模态视图时,它会触发滚动条消失.这是一个令人讨厌的效果,因为当模态移入/消失时背景页面开始移动.有没有办法治愈这种影响?

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?

推荐答案

这是一项功能,当您显示模式,并在您隐藏它时删除.

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

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

This makes the scrollbar disappear since the bootstrap css says

.modal-open {
    overflow: hidden;
}

您可以通过指定来覆盖它

You can override this by specifying

.modal-open {
    overflow: scroll;
}

你自己的 css中.

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

08-30 09:57