DrewDahlman/Mason

Uncaught TypeError: Cannot set property '0' of undefined

Opened this issue · 6 comments

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

THanks

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

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

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.

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!

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:

  • $("#grid1").mason(...)
  • $("#grid2").mason(...)
    Could you please give me some ideas about this?

Thanks!

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:

t = Math.round($block.position().top / elements.block.height)