Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizable grid items with dynamic content? #1000

Closed
ghost opened this issue Oct 3, 2017 · 1 comment
Closed

Resizable grid items with dynamic content? #1000

ghost opened this issue Oct 3, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Oct 3, 2017

I'm in the process of trying to figure out how to use the Masonry plugin for dynamic content (through a CMS) with varying grid item sizes while also making the items of the Masonry grid resizable (on click).

To do so, I am trying to adopt the function for having animated, resizable grid items (which was provided here: https://codepen.io/desandro/pen/JFpIB) in the Masonry grid for content with different heights.

Unfortunately, I have trouble getting it to work. So far, I am only able to create a Masonry grid with changeable grid item sizes where the height of the grid items is set manually in the CSS.

How do I have to change my setup in order for the grid to work properly with vary sizes? As soon as I try to fill the grid items with images of different sizes, the resizing animations break/glitch and the grid items start to overlap.

You can see it happening in this CodePen: https://codepen.io/joSch/pen/gGGELq

@desandro
Copy link
Owner

Thanks for reporting this issue. Looks like the problem is how the height is being set. The animated item sizes demo works by explicitly setting expanded sizes in CSS. With your demo, since it uses images with varying height, we can't use the same technique. One solution would be to calculate the height in JS.

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

No branches or pull requests

1 participant