Hacker News new | past | comments | ask | show | jobs | submit login

As I understand it, the hard part of a masonry layout is ensuring that items are laid out with the first items near the top of the screen and the last items near the bottom of the screen.

If you just plop your items into columns, the first items will all appear in the first column and the last items will all appear in the last column (left to right), which is not the behavior you want.

To my knowledge, the correct behavior cannot currently be created in CSS alone. (Or if it can, it must be a wild hack.)




If people want to choose where things land they can do that. Therefore I assume we're talking about a scenario where the items are not known in advance - i.e. they come from a database query or similar. Is there no way to SELECT every Nth item when doing a query? Return a count and select where count MOD N = k? Dump those in a column.

This feels like "I want my layout algorithm to be part of the standard." and if you don't think so, see the part where they also want the equivalent of "colspan = 2" for some itmes - possibly with another pattern to define which ones.


But what if you resize the browser or turn the screen on your iPad.

Would you really want that to trigger an entirely new set of SQL statements ?


> "I want my layout algorithm to be part of the standard."

I mean, yes... it's a very common layout algorithm so it gets standardized




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: