masonry icon indicating copy to clipboard operation
masonry copied to clipboard

Gutter wrong with Percentage column width and scrollbar wrap

Open Spiritvn opened this issue 12 years ago • 2 comments

Hi,

First, thanks for the V3 update with % support, very nice job!!!

Dont know if you guys experienced this. I'm using very simple Masonry, only apply Masonry with gutter 0, columnwidth default (first item size: 25%) but its wrapper have a fixed height then having scrollbar. On the first page load, the gutter appear few pixels.

I firgured out it's only wrong when it's container wrapper using scrollbar.

It will be counted correctly after window resize. So i think it's because of the wrong first time couting the size of the container when its container does have a scrollbar.

Reproduce the issue: http://codepen.io/anon/pen/fheao

Regards, Spirit.

Spiritvn avatar Jul 12 '14 23:07 Spiritvn

I found you can hack a solution by setting the min-height of the masonry container to at least as tall as its wrapping element

.masonry { min-height: 101%; }

See http://codepen.io/desandro/pen/fpcvr

desandro avatar Jul 13 '14 14:07 desandro

Wow, work like a charm! Thank you very much, can't believe how you can find that hack out. I think you should update into the document this case.

Spiritvn avatar Jul 13 '14 19:07 Spiritvn