Reputation: 7043
I am trying to add pinterest-like item style to my gallery, but getting huge gaps between my thumbnails. Found several similar questions on SO, but none of them helped with my situation, unfortunately.
script
$('#container').masonry({
itemSelector: '.container',
columnWidth : 100
});
gallery
<div id="container">
<div class="item">...</div>
</div>
styles
.item {
width: 122px;
margin: 5px;
float: left;
background-color: gray;
}
Thanks in advance
Upvotes: 2
Views: 1857
Reputation: 21050
Here's a working example, Have a look and let me know if this is what you're after.
$('#container').masonry({
itemSelector: '.item',
columnWidth : 100,
gutter: 10
});
#container .item {
background-color: gray;
width: 100px;
float: left;
margin-bottom: 10px;
}
Upvotes: 1