【发布时间】:2017-10-22 16:19:33
【问题描述】:
我一直在尝试在 div 标签内交换 Bootstrap 类属性。我想充分利用 Bootstrap 12 列网格,但将 12 列切换为 9 列和 3 列布局。示例如下:
这是JDFIDDLE DEMO。这是示例代码:
<div class="container-fluid col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div id="LeftColumn" class="col-md-9 col-sm-9 col-xs-12">
<h3>Left Column</h3>
<p>Currently is set to col-md-9, but it should initially be col-md-12 and be toggled to col-md-9 while maintining the its responsive properties.</p>
<p><span class="strong">DESIRED RESULT:</span>Toggle the properties <div class="col-md-12 col-sm-12 col-xs-12"> to <div class="col-md-9 col-sm-9 col-xs-12"> when the "Toggle Right" column button is clicked while maintaining the existing functionality.</p>
</p>
<div id="Bar" class="main-container collapse in">
<a href="#Foo" class="btn btn-success" data-toggle="collapse">Toggle Right</a>
</div>
<div class="clearfix"></div>
<br />
</div>
<div id="RightColumn" class="col-md-3 col-sm-3 col-xs-12">
<div id="Foo" class="main-container collapse" style="border: dotted 1px green;">
Toggle Left Column <a href="#Bar" class="btn btn-warning" data-toggle="collapse"><i class="fa fa-bars"></i></a>Additional content will be displayed in this column once triggered.
<div style="height: 150px;"></div>
</div>
</div>
</div>
我需要保持现有按钮“向右切换”和“向左切换”按钮中已有的切换功能。
我非常感谢您对 RightColumn 和 LeftColumn 中的类分别从 12 (col-md-12) 切换到 9 (col-md-9) 和 3 (col-md-3) 的帮助。
【问题讨论】:
标签: javascript jquery twitter-bootstrap jquery-ui toggle