简体   繁体   English

结合使用引导网格和缩略图网格以及扩展预览

[英]Using bootstrap grid with thumbnail grid with expanding preview

I'm creating a site and am using this bootstrap based theme as a starting base. 我正在创建一个网站,并将这个基于引导程序的主题用作起点。 I've also incorporated the very nice Thumbnail Grid with Expanding Preview as described in this Codrops tutorial . 正如Codrops教程中所述,我还结合了非常漂亮的Thumbnail Grid和Expanding Preview

What I'm trying to do is keep the portfolio grid that you can see in the theme where all the preview images are responsive bootstrap col-lg-4 col-sm-6 elements so that they will expand & shrink to fill the full browser width and adjust the number of elements per row depending on screen width. 我正在尝试做的是保持在主题中看到的投资组合网格,在该主题中所有预览图像都是响应式引导col-lg-4 col-sm-6元素,以便它们可以扩展和收缩以填充整个浏览器宽度,并根据屏幕宽度调整每行的元素数。

The JS that drives the thumbnail grid with expanding preview effect is grid.js and I had thought that if I made the following adjustments that it would apply the same effect: 通过扩展预览效果来驱动缩略图网格的JS是grid.js ,我曾想过,如果进行以下调整,它将应用相同的效果:

var Grid = (function() {
    // grid selector
    var $selector = '#og-grid',
    // list of items
    $grid = $( $selector ),
    // the items
    $items = $grid.children( '.grid-item' ),
    // ... etc ...

ie: I've set items to be .grid-item instead of li and updated the bootstrap divs so that they have this class too. 即:我将项目设置为.grid-item而不是li并更新了引导程序div,以便它们也具有此类。

I've uploaded a snapshot of where I'm at right now here which basically has the thumbnail grid with expanding preview effect implemented as per the Codrops tutorial, but I'm hoping to be able to keep the responsive benefits associated with the original theme's portfolio section. 我上传的我在目前位置快照这里基本上与扩大预览效果实现为每Codrops教程缩略图网格 ,但我希望能够保持与相关的响应好处原来的主题的投资组合部分。 Does anyone have any suggestions as to how I might be able to achieve what I'm hoping to do? 有没有人对我如何能够实现我希望做的事情有任何建议? Please just ask if further clarification is required on what I'm trying to figure out. 请问是否需要进一步澄清我要弄清楚的内容。

As suggested by @KarlDawson, I just set up some media queries and the items rendered as expected: 正如@KarlDawson所建议的那样,我只是设置了一些媒体查询,并按预期方式渲染了项目:

@media (min-width: 768px) {
  .og-grid li {
    width: 50%;
  }
}

@media (min-width: 1200px) {
  .og-grid li {
    width: 33.33333333333%;
  }
}

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

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