DrewDahlman / Mason

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

fixed outer container (both height and width) #56

Closed elmcrest closed 8 years ago

elmcrest commented 8 years ago

Hey Drew,

excuse me if this like the Enhancement-Issue (#30) but I'm not sure if it is.

it feels like your plugin is doing nearly what I need but I might not be capable of tweaking it accordingly.

What I need is a fixed height and width Container (100%, 100%) and an arbitrary number of elements is getting fitted into the area.

Imagine a Chessboard just with an arbitrary number of black and white fields.

To give you a real world example - we have a Screen here in our office showing some planning (from 5-15 elements) cards / tiles ... and the most important part is that all elements are shown.

and thx for your work, even if it'd turns out I can't use it :) :+1:

Marius

elmcrest commented 8 years ago

of course if anyone else has some tips for me I'd appreciate that :)

DrewDahlman commented 8 years ago

You could probably pull this off with some trickery... the issue is that Mason likes to fill the total space vs a specific space, if that makes sense.

You'll notice in the examples for promoted http://masonjs.com/#grid-c the grid stays the same configuration / size on every refresh. This is because the promoted elements are forcing their size thus creating a grid that never changes.

There could also be some tweaks made to the overall code to change it to use 100% x 100% but that would require some re-tooling and re-thinking around the layout algorithm.

elmcrest commented 8 years ago

ok, cool. then I guess I need to solve this different.

thx anyways so far.