【问题标题】:Bootstrap modal doesn't remain fixed when scrolling滚动时引导模式不保持固定
【发布时间】:2013-10-25 08:14:46
【问题描述】:

我在我的网站和一个页面上使用 snap.js,这是一个默认情况下具有固定位置的 Bootstrap 模式。但是,我相信由于此模式位于具有绝对定位的 .snap-content 容器中,因此模式不会保持固定并与页面的其余部分一起滚动。有什么建议吗?

【问题讨论】:

  • 你能显示一些代码吗?

标签: twitter-bootstrap scroll popup modal-dialog fixed


【解决方案1】:

我也遇到了同样的问题。

我想出的解决办法是修改 snap.css

.snap-content {
 position: absolute;
 top: 0;
 right: 0;
 bottom: 0;
 left: 0;
 width: auto;
 height: auto;
 z-index: 2;
 overflow: auto;
 -webkit-overflow-scrolling: touch;
 /*-webkit-transform: translate3d(0, 0, 0);*/
 /*-moz-transform: translate3d(0, 0, 0);*/
 /*-ms-transform: translate3d(0, 0, 0);*/
 /*-o-transform: translate3d(0, 0, 0);*/
 /*transform: translate3d(0, 0, 0);*/
}

我仍然不知道为什么这会改变模态框的行为,但到目前为止,它在使用按扣抽屉时也没有问题

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多