(6)
1
Strona wtyczki
Oficjalna witryna wtyczki
Github
Repozytorium Github
Zobacz więcej
RowGrid.js to lekki (skompresowany około 700 bajtów) plugin do umieszczania zdjęć (lub innych elementów) w prostych rzędach.Siatka podobna do do tej zastosowanej w Google Grafika, Flickr, Shutterstock. RowGrid.js może być połączony z pluginami do nieskończonego przewijania np. Endless Scroll.
Instalacja
  • CSS
  • HTML
  • JS
.container {
  background: #eee;
}
/* clearfix */
.container:before,
.container:after {
    content: "";
    display: table;
}
.container:after {
    clear: both;
}

.item {
  float: left;
  margin-bottom: 10px; 
}
.item img {
  max-width: 100%;
  max-height: 100%;
  vertical-align: bottom;
}
.first-item {
  clear: both;
}
/* remove margin bottom on last row */
.last-row, .last-row ~ .item {
  margin-bottom: 0;
}
<div class="container">
  <div class="item">
    <img src="path/to/image" width="120" height="100" />
  </div>
  <div class="item">
    <img src="path/to/image" width="130" height="100" />
  </div>
  ...
</div>
$(document).ready(function() {
  var options = {minMargin: 5, maxMargin: 15, itemSelector: ".item", firstItemClass: "first-item"};
  $(".container").rowGrid(options);
});