Skip to content

Instantly share code, notes, and snippets.

@WolfgangDrescher
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WolfgangDrescher/a4ffe367fdabba558cdf to your computer and use it in GitHub Desktop.
Save WolfgangDrescher/a4ffe367fdabba558cdf to your computer and use it in GitHub Desktop.
Resets expanding cols in Bootstraps gird system
<div class="container">
<div class="row">
<?php foreach(GalleryAlbum::findAll() as $key => $album): ?>
<div class="col col-xs-12 col-sm-6 col-md-4 col-lg-3">
<!-- col content, gallery image-->
</div>
<div class="clearfix visible-xs-block<?php
if(($key + 1) % 2 == 0) {
echo ' visible-sm-block';
}
if (($key + 1) % 3 == 0) {
echo ' visible-md-block';
}
if (($key + 1) % 4 == 0) {
echo ' visible-lg-block';
} ?>"></div>
<?php endforeach; ?>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment