Twitter bootstrap 是否有一种简单的方法来禁用小屏幕的特定模式?
我使用的是TwitterBootstrap3.1.1中的modals,对于小于700像素的屏幕,我的modals是非常无用的,并且具有边界入侵性 是否有一个简单的功能或方法来禁用小屏幕的模态 编辑:添加相关html:Twitter bootstrap 是否有一种简单的方法来禁用小屏幕的特定模式?,twitter-bootstrap,bootstrap-modal,Twitter Bootstrap,Bootstrap Modal,我使用的是TwitterBootstrap3.1.1中的modals,对于小于700像素的屏幕,我的modals是非常无用的,并且具有边界入侵性 是否有一个简单的功能或方法来禁用小屏幕的模态 编辑:添加相关html: <div class="post-body-img"> <a data-toggle="modal" data-target="#myModal"> <img src="test.jpg"> </a>
<div class="post-body-img">
<a data-toggle="modal" data-target="#myModal">
<img src="test.jpg">
</a>
</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<a data-dismiss="modal">
<img src="test.jpg">
</a>
</div>
</div>
</div>
</div>
是,使用引导响应实用程序类。您可以将
visible md
和visible lg
添加到模式链接。启动模式的链接将仅在中型(>=992px)或大型(>=1200px)屏幕上显示
如果您不想在较小的屏幕上隐藏模式链接,那么只需添加另一个。因此,您将有两个这样的链接:
<div class="post-body-img">
<a class="hidden-xs" data-toggle="modal" data-target="#myModal"> <!--hidden on mobile, add hidden-sm to hide on tablet-->
<img src="http://placehold.it/100">
</a>
<a class="visible-xs"> <!--shows on mobile, add visible-sm to show on tablet-->
<img src="http://placehold.it/100">
</a>
</div>
可以使用CSS和隐藏模态及其背景!重要信息
声明,当模态打开时,它会覆盖模态元素上的内联显示:块
样式。要将其隐藏为特定大小,只需将以下CSS放入相关的媒体查询中:
#yourModalID.modal.in,
#yourModalID.modal.in + .modal-backdrop.in
{
display:none !important;
}
不幸的是,这仍然会打开暗层(模式背景
),并且无法删除,因为没有关闭按钮等。无论如何,要轻松防止小屏幕显示背景?对不起,您说的是模式链接。但我需要模态链接。我使用模态来“放大”图像,有点像灯箱效果。所以,我不能完全隐藏缩略图。我想在不移除按钮或图像的情况下阻止modals显示,这些按钮或图像将数据切换到它。好的,我可以试着弄清楚这一点,但你需要在你的问题中添加相关的html。完成了。希望有帮助。我试过了,但不起作用。我不确定我做错了什么。我的代码:.options\u section\u modal.modal.in{display:none!important;}.options\u section\u modal.modal background.in{display:none!important;}