Mitch Malone
Mitch Malone

Reputation: 892

Keeping grid order when using jQuery Masonry

I am currently using jQuery Masonry to make a grid layout. Each item in the grid has the same dimensions, except when that item is hovered when it gets slightly larger. This causes a problem however and the grid becomes unordered.

See example of issue here on jsFiddle.

Is there a way to force jQuery Masonry to keep the grid order (L to R, Top to Bottom) at all times? Either with options or by modifying the jQuery Masonry code slightly? If modification of jQuery Masonry is required please use this gist to make things easier.

Upvotes: 4

Views: 1637

Answers (1)

PHearst
PHearst

Reputation: 771

Try only manipulating the item that is being hovered ($(this) ) and you dont' really need to reload the masonry grid when doing this.

Here's a Fiddle

Upvotes: 1

Related Questions