javascript - Generate a masonry layout and then apply gravity to it -


here's weird 1 i've been wracking brain on.

i want 2 things, in order:

  1. generate masonry-style layout list of divs, imgs, or whatever. these utilize images can background images, within divs, or other method works. can pure css or jquery plugin.

  2. once grid has been generated, apply physics based plugin '.throwable' individual divs/objects. objects fall on each other, overall retain structure, you'd see in angry birds or something.

the goal here paste in list of divs, let jquery plugin or pure css automatically figure out how align them, , apply gravity masonry grid.

the problem i've run on , on masonry grid generated... when apply physics system it, individual objects snap different position. think masonry wants them "relative" while physics system wants them in "absolute"? not sure...

i have rough version of latest attempt here if wants idea of i'm attempting: http://cssdeck.com/labs/full/f5dm0zv8

jasper's reply hinted @ solution, although i'm not sure why things seemed work time me. had tried multiple javascript/jquery based masonry plugins, , nothing had worked. ended trying "http://masonry.desandro.com/methods.html" , ended working me. thought had tried 1 - maybe not? anyways, have more or less working example here, new issues have arisen: http://output.jsbin.com/runewidapi/2/


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -