【问题标题】:Fitting pusher to browser window when sidebar is open侧边栏打开时将推送器安装到浏览器窗口
【发布时间】:2015-07-13 06:29:23
【问题描述】:

让我们考虑以下语义-ui页面结构(使用meteor):

  <div class="ui top attached demo menu">
    {{> header}}
  </div>
  <div id="main" class="ui bottom attached segment">
    <div class="ui teal labeled left inline vertical sidebar menu">
      {{> sidebar}}
    </div>
    <div class="pusher">
      {{> yield}}
    </div>
  </div>

作为 pusher 中的内容,一个网格的图像如下:

 <div class="ui sixteen column wide center aligned grid book-grid">
    {{#each book}}
    <div class="center aligned column item">
      <div class="ui basic segment">
        <img src="{{cover}}" class="ui fluid image">
        <p>{{title}}</p>
      </div>
    </div>
    {{/each}}
  </div>

是否可以在侧边栏打开时让推送器动态适应浏览器?我的内容被推到屏幕外(标准行为),但我希望图像网格适应新的面板宽度。谢谢

【问题讨论】:

    标签: css meteor grid sidebar semantic-ui


    【解决方案1】:

    不是最优雅的解决方案,但您可以通过添加事件来捕获侧边栏的显示/隐藏来手动调整 .pusher 的宽度。

    关键是提供百分比宽度。也请查看Bootstrap's Grid System

    【讨论】:

    • 是的,考虑过这一点,但我认为必须有一种更“语义化”的方式来做到这一点。不幸的是,几乎没有关于它的文档......
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-23
    • 1970-01-01
    • 2011-02-18
    • 1970-01-01
    • 1970-01-01
    • 2014-05-02
    • 1970-01-01
    相关资源
    最近更新 更多