javascript - 根据设备大小制作一个按钮到模式结束

标签 javascript jquery html css twitter-bootstrap-3

我正在使用 bootstrap3,我正在使用模态来呈现表单。有什么方法可以使模态根据设备窗口大小占据移动设备的整个高度。此外,我在模态中有一个按钮。该按钮应该总是在模态的末尾。我正在尝试使用 jquery..有没有纯 CSS 的方法

<div class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
    <h4 class="modal-title">Modal title</h4>
  </div>
  <div class="modal-body">
    <p>One fine body&hellip;</p>
  </div>
  <div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
    <button type="button" class="btn btn-primary">Save changes</button>
  </div>
</div></div>

我需要这个 bootstrap modal 来占据移动页面的整个高度,modal-footer 容器应该总是在云的尽头,不管 modal-body 内容如何

最佳答案

只需编写您自己的 CSS,以便将模式的最小高度设置为 100%...因为模式背景是 100% 高度,所以 min-height: 100% 应该可以工作。

关于javascript - 根据设备大小制作一个按钮到模式结束,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27103059/

相关文章:

javascript - 遍历 html 数组在 javascript 中不起作用

javascript - 如何使输入字段只接受 javaScript 中的字母?

javascript - jspdf 将 html (div) 导出到 pdf 不起作用

android - 使用 JSoup 解析 Twitter

javascript - $state.go() 不在 ionic 应用程序中加载 Controller

javascript - Jquery 与 Ajax 的动态列表

javascript - Angular JS 中的堆叠条形图(高图表)

javascript - 当键有多个条目时,如何处理二维数组搜索?

css - 设置 CSS 后 Canvas 坐标可能不起作用

javascript - anchor 元素中的 href 是强制性的吗?