gpt4 book ai didi

jquery - CSS:在bootstrap modalWindow中隐藏一个滚动条

转载 作者:太空宇宙 更新时间:2023-11-03 23:20:57 25 4
gpt4 key购买 nike

在我的应用程序中,我使用 Bootstrap 。并且我的页面必须始终带有滚动条。现在我遇到了一个麻烦:如果我的模态很大(按高度计算)- 我会得到两个侧滚动条...

只用一个滚动条滚动模态是真的吗?

html-css 的一部分:

html{
overflow-y: scroll;
}

html, body {
height: 100%;
}

我的意思是:

modal scrollbar

这里是 plunker:

http://plnkr.co/edit/QHpjmpQHW1vZWd69Tm7A?p=preview

只用一个卷轴是真的吗?以及如何?

最佳答案

我遇到了同样的问题。我用 jQuery 修复了它。当您打开模式时,添加一个事件以将 modal-open 类添加到您的 html 元素。

$('html').addClass('modal-open');

当您关闭模式时,添加一个事件以从您的 html 元素中删除 modal-open 类。

$('html').removeClass('modal-open');

关于jquery - CSS:在bootstrap modalWindow中隐藏一个滚动条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28713596/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com