【问题标题】:Bootstrap 3 variable modal width displays double scrollbarsBootstrap 3 可变模态宽度显示双滚动条
【发布时间】:2015-03-07 15:06:54
【问题描述】:

我已按照本教程进行操作:

http://scottpdawson.com/development/creating-a-variable-width-modal-dialog-using-bootstrap-3/

为了使模态窗口宽度可变。一切正常,除了两件事: 1)。将窗口大小调整为小尺寸后,会出现双“y”滚动条。

2)。此外,当调整窗口大小时,模态窗口会被拉到左角,而它应该居中。

这很奇怪,因为教程中的演示代码运行良好,但在我的情况下却没有......

有什么帮助吗?

现场示例在这里:http://tedxmru.com/ted-mob/

按下 Concept 按钮会打开存在这些问题的宽模式

【问题讨论】:

    标签: css twitter-bootstrap bootstrap-modal


    【解决方案1】:

    将此添加到您的 css 中

    @media screen and (min-width: 767px) {
        html {
            overflow-y:hidden !important;
        }
    }
    

    但是,这样做之后您将无法滚动主页。

    类似问题:

    Bootstrap 3 modal creates scrollbar when opened

    How to hide the body scroll bar when showing modal dialog?


    另外,我想推荐这个插件,它可以快速生成模态窗口 - Remodal

    【讨论】:

    • 抱歉,这不起作用。我已经尝试过这种方式,但没有运气:.modal-wide .modal-body { overflow-y: hidden !important; overflow-x: auto; height: auto; }
    • 你确定你将它应用到你的 标签本身吗?我在 chrome 开发者窗口中试了一下,结果很好。
    • 这样,正如您所说,默认的 y-scrollbar 已关闭,页面根本不滚动。还有问题的模态窗口仍然没有修复
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-04-01
    • 1970-01-01
    • 2013-09-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-06
    相关资源
    最近更新 更多