jackoverflow
jackoverflow

Reputation: 21

jquery masonry animating items

I have implemented jquery masonry and played with it a bit.

Here's my work: http://jsfiddle.net/jackoverflow/JDAmS/

As you can see, clicking "expand" will animate the item having a width of "300px" and collapses back to it's normal width on "collapse" click.

All is working okay EXCEPT when clicking the "first item" which collapses all the items.

can someone help me please?

Any help is much appreciated!

Upvotes: 2

Views: 1199

Answers (1)

desandro
desandro

Reputation: 2894

From the Masonry docs - Help - First item breaks grid:

If you run into an issue where you re-size the first item, and all the rest of the items no longer fit together in the grid, you most likely need to set columnWidth option. Without columnWidth set, Masonry will use the width of the first item for the size of its columns.

$('#container').masonry({
  columnWidth: 220
});

Upvotes: 1

Related Questions