css - 列更改大小时重排内容

标签 css twitter-bootstrap twitter-bootstrap-3

需要一点帮助。我已经为这个问题苦苦挣扎了几天。

我正在使用下面找到的方法切换列。

Bootstrap toggle left column in a two column row

在我较大的列 (Col1) 中,当我暴露右列 (col2) 时它会缩小,我希望我的两列(col1, col1 和 col1, col2)调整为单列。我正在用头撞墙试图解决这个问题。我敢肯定,当有人展示解决方案时,我会觉得自己很傻,这是一件非常明显的事情。

<div class="container-fluid">
  <div class="row">
    <div id="list-col" class="col-xs-12">
      <div class="container-fluid">
        <div class="row">
          <div class="col-xs-6 item">
          Col1, col1
          </div>
          <div class="col-xs-6 item">
          Col1, col2
          </div>
        </div>
      </div>
    </div>
    <div id="map-col" class="col-xs-0">COL 2</div>
  </div>
</div>

https://jsfiddle.net/td234/qu7j21pm/1/

感谢所有帮助!

汤姆

最佳答案

只需要将 col-xs-6 列上的类切换为 col-xs-12

$('.item').toggleClass('col-xs-12 col-xs-6');

关于css - 列更改大小时重排内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36265634/

相关文章:

css - 带有内联 block 显示的表格内行上不需要的空单元格

在 Microsoft Edge 中使用 calc 的 CSS 关键帧

javascript - 使用 Jquery 单击时使链接加粗

html - 图片 :first-child not working for my first image

html - 使用 Bootstrap 对齐输入框下的标签

javascript - 将字形图标对齐到文本输入框的右侧和内部

javascript - 拖动项目时触发的单击事件 (Firefox)

html - Bootstrap 图标与输入不对齐

html - 如何使用 bootstrap 3.0 右对齐元素?

c#-4.0 - 使用引导显示格式将输入字段绑定(bind)到 MVC5 中的模型