DrewDahlman / Mason

Mason.js for creating a perfect grid with jQuery.
http://masonjs.com/
MIT License
1.22k stars 183 forks source link

Uncaught TypeError: Cannot set property '0' of undefined #50

Open ghost opened 9 years ago

ghost commented 9 years ago

I'm getting this error right out of the box, testing it with the examples, using latest version from bower, any idea why?

THanks

DrewDahlman commented 9 years ago

Hmm not sure - just put this together http://jsfiddle.net/bvmp3gqe/ using fluid example

ghost commented 9 years ago

Could it be related that my wrapper div has a fixed height?

DrewDahlman commented 9 years ago

Yep. That would cause it. It needs a flex height in order to size properly.

Sent from my Delorean

On Jun 5, 2015, at 10:55 AM, Marti Planellas notifications@github.com wrote:

Could it be related that my wrapper div has a fixed height?

— Reply to this email directly or view it on GitHub.

ghost commented 9 years ago

Hi @DrewDahlman , I'm trying to do a horizontal grid, so I need a fixed height, is there any way of doing that? How would I need to modify the library to achieve it?

Thanks!

tamtrong commented 6 years ago

Hi @DrewDahlman , your mansonjs is cool. However, when I create 2 grids in the same page ( #grid1 & #grid2), the Error "Cannot set property '0' of undefined" always appears despite I config the grids seperately:

Thanks!

bl0wfish commented 6 years ago

Applying position:relative to the container fixes it for me. The problem is caused by the calculation of a block's top offset. If positioning is not relative it will be the offset to the top of the page, instead of the container: https://github.com/DrewDahlman/Mason/blob/758d4ed3a45e0b8a6ab8a55f923dd465386bc722/src/mason.coffee#L301