简体   繁体   English

Bootstrap 响应式:在折叠模式下显示多个 div

[英]Bootstrap Responsive : Show multiple div in collapse mode

In bootstrap nav we can show the menu in collapsing format.在引导程序导航中,我们可以以折叠格式显示菜单。 Similary I want to show div in the collasing format.类似地,我想以 collasing 格式显示 div 。 eg if it is is mobile view then only show the top div and hide all the div in collapse mode .例如,如果它是移动视图,则只显示顶部 div 并在折叠模式下隐藏所有 div。 I am aware of the below supports in bootstrap responsive我知道引导响应中的以下支持

.visible-phone  
.visible-tablet 
.visible-desktop
.hidden-phone
.hidden-tablet
.hidden-desktop

If it is not supported please all share the idea how it can be implemented.如果不支持,请大家分享如何实施的想法。

nirajkumar , have a look at this Fiddle . nirajkumar ,看看这个小提琴
You can use the .hidden-xs Bootstrap class to do what you want here. 您可以在.hidden-xs Bootstrap类中执行所需的操作。
Using version 3.3.4. 使用版本3.3.4。

<div class="col-xs-12 col-sm-6 col-sm-offset-3 col-md-4 col-md-offset-1 col-lg-3 col-lg-offset-1 text-center block2 hidden-xs">
     Div #1
</div>
<div class="col-xs-12 col-sm-12 col-md-4 col-md-offset-2 col-lg-3 col-lg-offset-4 text-center block2">
     Div #2
</div> 

This is listed in the official Bootstrap docs. 这在官方的Bootstrap文档中列出。 Here's the link: http://getbootstrap.com/css/#responsive-utilities-classes 这是链接: http : //getbootstrap.com/css/#sensitive-utilities-classes

I assume you can use Javascript. 我假设您可以使用Javascript。 You can create collapse effect with JavaScript (already implemented in Bootstrap : http://getbootstrap.com/javascript/ look for "collapse"). 您可以使用JavaScript创建折叠效果(已经在Bootstrap中实现: http : //getbootstrap.com/javascript/查找“折叠”)。 In fact you don't need to write any Javascript code at all. 实际上,您根本不需要编写任何Javascript代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM