twitter-bootstrap - Bootstrap 3 modal 从页脚开始,就像 Badoo 上的一样
问题描述
我正在尝试创建一个在页面底部为移动设备打开的 Bootstrap 3 模式,就像 Badoo 正在使用的那样:)
所以票价我想出了这个:
.modal {
position:fixed;
top:auto;
right:auto;
left:auto;
bottom:0;
}
.modal.fade .modal-dialog {
transform: translate3d(0, 100vh, 0);
}
.modal.in .modal-dialog {
transform: translate3d(0, 0, 0);
}
如何使它像屏幕截图上的模态?
解决方案
我已经修改了你的代码,试试这个:
HTML:
<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg">Modal test</button>
<div id="table"></div>
<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<ul>
<li>Add to Favourites</li>
<li>Skip</li>
<li>View profile</li>
<li>Report</li>
</ul>
</div>
</div>
</div>
CSS:
#table {
border: solid 1px red;
height: 500px;
width: 500px;
}
.modal {
position: fixed;
bottom: 0px;
}
.modal-dialog {
position: fixed;
bottom: 0;
margin: 0;
width: 100vw;
}
.modal-header {
padding: 0;
}
.modal-content {
border-radius: 20px 20px 0 0;
}
ul {
padding: 0;
margin: 0;
}
li {
display: block;
color: black;
text-align: center;
padding: 10px 0;
border-top: 1px solid LightGray;
}
li:first-child {
border: none;
}
li:last-child {
color: red;
}
当然,您需要添加适当的响应式断点。
推荐阅读
- javascript - 如何在 React JS 中使用来自不同文件的 Consts
- reactjs - React - 从全局上下文中过滤获取的数据的问题
- eclipse - 如何在 Eclipse/TestNG 中切换/禁用注释帮助器链接?
- python - 停止 Python 容器很慢 - SIGTERM 未传递给 Python 进程?
- typescript - 打字稿在高阶函数中推断内部函数的类型
- python - 基于用户输入将多个过滤器应用于数据框的pythonic方法
- matlab - 如何使用 Octave 或 MATLAB 计算贝叶斯估计量
- google-chrome - LiveReload 扩展在 Mozilla 上有效,但在 Chrome 或 Brave 上无效的原因可能是什么?
- mysql - 获取特定人员的列中最常见的值
- javascript - 使用 onChange 函数和 React Hooks 添加多个文件,但单独添加