Skip to content
This repository was archived by the owner on Jan 4, 2022. It is now read-only.

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

Open
ghost opened this issue Jun 5, 2015 · 6 comments
Open

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

ghost opened this issue Jun 5, 2015 · 6 comments

Comments

@ghost
Copy link

ghost commented Jun 5, 2015

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
Copy link
Owner

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

@ghost
Copy link
Author

ghost commented Jun 5, 2015

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

@DrewDahlman
Copy link
Owner

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 [email protected] wrote:

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


Reply to this email directly or view it on GitHub.

@ghost
Copy link
Author

ghost commented Jun 7, 2015

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
Copy link

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!

@bl0wfish
Copy link

bl0wfish commented Nov 21, 2017

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants