desandro / draggabilly

:point_down: Make that shiz draggable
https://draggabilly.desandro.com
MIT License
3.86k stars 387 forks source link

A way to expand tiles without moving other tiles (and also expand on top) #144

Closed 7ruth closed 7 years ago

7ruth commented 7 years ago

I love all the work that you have done with metafizzy (I am still pretty new to coding and so far I have spent a good amount of time playing around with packery, which was phenomenal at helping me grasp JS due to how much visual feedback you get as you work on it) and now I am back looking at yet another awesome project you put together. Here is my question...

http://codepen.io/7ruth/pen/GNBwJw

In the demo above, when I click the expand button on a tile, the tile expands, its canvas moves under subsequent tiles (if they are on the same Y level) and pushes all tiles below it, further down.

However if I expand the last created tile, it does not affect any previously created tiles while its canvas also rests on top of other tiles.

Is there a way to get all tiles to behave like the last created tile? (on expand, their canvas to be the highest one in the order as well as not moving away any sibling tiles?)

Is this possible? Thank you for any tips/help!

7ruth commented 7 years ago

I played around with it over the weekend and realized how simple it was. Draggabilly is awesome.

Demo: http://codepen.io/7ruth/pen/GNBwJw

Just need to add 'position':'absolute' to the css.