【问题标题】:Bootstrap modal not scrolling with overflow: scroll引导模式不滚动溢出:滚动
【发布时间】:2017-11-08 06:04:32
【问题描述】:

我添加了一个引导模式以用作网站上的条款和条件,但它不会滚动。我认为它在我的代码中。

我尝试将溢出设置为滚动和自动,但它不起作用

    <div id="tallModal" class="modal modal-wide fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Terms and conditions</h4>
      </div>
      <div class="modal-body">
        <%= render 'terms', client: @client %>
      </div>
      <div class="modal-footer">
        <button type="button" class="" data-dismiss="modal">Agree and close</button>
        <button type="button" class="" data-dismiss="modal">Close</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script>

CSS

.modal.modal-wide .modal-dialog {
  width: 60%;
}
.modal-wide .modal-body {
  overflow-y: scroll;
}
.modal-body {
  max-height: 70vh
}

如果您想进一步检查代码,我正在 Heroku 上测试该应用程序。 https://safe-shore-24087.herokuapp.com/

【问题讨论】:

    标签: css bootstrap-modal


    【解决方案1】:

    Bootstrap 的模式与您的 parallax.js 冲突,只需禁用它(尝试使用另一个库或引发错误),它应该可以按预期工作。

    【讨论】:

    • 感谢您的帮助:)
    • @Allan 很高兴为您提供帮助 :)
    猜你喜欢
    • 1970-01-01
    • 2018-11-03
    • 1970-01-01
    • 1970-01-01
    • 2021-12-15
    • 1970-01-01
    • 2012-01-21
    • 2012-04-11
    • 1970-01-01
    相关资源
    最近更新 更多