css - 防止模态在移动设备上上下移动?
问题描述
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered justify-content-center" id="modalInner" role="document">
<div id="innerContentWrapper">
<a class="prev">❮</a>
<a class="next">❯</a>
<div id="innerContent"></div>
</div>
</div>
</div>
我正在使用引导手机制作灯箱画廊。在移动设备上,当用户滑动时,它会使模态上下跳跃。我怎样才能修复它?
解决方案
您可以尝试在特定于移动视图的媒体查询中修复其位置:
@media only screen and (max-width : 768px) {
.modal {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 999;
}
}
推荐阅读
- javascript - 如何检查消息是否成功保存到本地 Redis?
- javascript - 是否有任何解决方案可以删除对 Element.querySelector 和其他 dom 访问方法的访问?
- php - 在 Flutter 注册 php 和 mysql 中检查注册用户
- c# - 图像中的字体未显示
- php - 实施服务费/使用 Braintree 支付 2 个单独的帐户
- javascript - 为什么我的每个循环只添加最后一个元素?
- mysql - MYSQL 日期验证令人头疼的问题
- tensorflow - 用于“头部姿势”检测的预训练“CNN”模型
- sumo - 相扑逻辑搜索查询
- amazon-web-services - 如何通过私有 IP 在浏览器中查看我正在运行的 docker 镜像?