-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple masoned containers on a page #161
Comments
No biggie. This is basic HTML & jQuery. Your HTML should probably look something like <div id="albums" class="container">
<div class="album item"></div>
<div class="album item"></div>
<div class="album item"></div>
...
</div>
<div id="singles" class="container">
<div class="single item"></div>
<div class="single item"></div>
<div class="single item"></div>
...
</div> We have two containers, so we can initialize two instances of Masonry $(function(){
$('#albums').masonry({
itemSelector: '.album',
columnWidth: 240
});
$('#singles').masonry({
itemSelector: '.single',
columnWidth: 240
});
}); If the sizes of the items $('.container').masonry({
itemSelector: '.item',
columnWidth: 240
}); |
Thank you so much, you are truly wonderful! |
What if one needs to specify the parent for multiple containers instead of child elements? Great solution for a great product, anyway! |
Forgive me if this is obvious, but I've searched all the issues and examples and cannot find what I need... I'd like to have two different containers "masoned" on the same page... they are separated by a title, so for example I have
Albums
{container with images for albums}
Singles
{container with smaller images for singles}
I don't want the singles overrunning the album section, I need them to stay separated.
thank you,
Elena
The text was updated successfully, but these errors were encountered: