Reputation: 53
I am using masonry in my application. Everything worked fine except when the height of the items change (like an accordion) masonry is not adjusting the layout. What can I do to fix it?
Upvotes: 5
Views: 6017
Reputation: 49
$grid.on( 'shown.bs.collapse hidden.bs.collapse' , function() {
$grid.masonry();
});
Upvotes: 0
Reputation: 89171
Whenever the items are resized, you need to tell masonary to re-layout everything:
$('.ui-accordion').bind('accordionchange', function(event, ui) {
$('#container').masonry();
});
Upvotes: 6