dmotz / oriDomi

🪭 Fold up DOM elements like paper
https://oxism.com/oriDomi
MIT License
2.41k stars 207 forks source link

Center a OriDomi element? #46

Closed jedrichards closed 9 years ago

jedrichards commented 9 years ago

Thanks for your work on this, its a beautiful effect!

Is it possible to horizontally center a oridomi element somehow, even while part folded? At the moment it seems like the width of the element stays at the unfolded original value, so when folded the whole element is off to the side. Any workarounds?

Ty!

dmotz commented 9 years ago

Since CSS transforms don't affect DOM flow, the container's size doesn't change when folding. You could use a callback and manually offset the OriDomi element based on the fold angle, but it'll be tricky since the width will depend on the perspective and effect settings.