javascript - Unfold animation on DIV with Oridomi (JS) -
i'm using oridomi (oridomi.com) javascript plugin achieve paper folding animation. specifically, have div unfold on page load (picture book opening).
however having difficulty getting unfold() method work, despite being method can called on plugin.
you can see example, can div fold back, rather unfold folded state (in effect, animation reversed).
my javascript function -
(function(){ function init(){ var $domi = $('.unfold').oridomi({ vpanels: 2, hpanels: 1, speed: 500, shading: false }); settimeout(function(){ $domi.oridomi('reveal', -90); }, 600);} document.addeventlistener('domcontentloaded', init, false); })();
and css -
.unfold { font-family: "abril fatface", "hoefler text", constantia, palatino, georgia, serif; font-size: 4.5rem; width: 25rem; height: 10rem; text-align: center; line-height: 1; color: #ff676d; background-color: #6ac1ff; padding: 2.5rem 0; }
the documentation on http://oridomi.com not clear on how can implemented. appreciated. thanks
if oridomi not supports reverse have 2 options. 1 know end stare , domi.oridomi('reveal', 0);
. other reverse first on speed of 0 , reveal @ 0deg unfold. here fiddle this:
(function fold() { var $domi = $('.unfold').oridomi({ vpanels: 2, hpanels: 1, speed: 500, shading: false }); $domi.oridomi('reveal', -90); settimeout(function () { $domi.oridomi('reveal', 0); }, 1000); })();
please note if nice effect, oridomi making mess dom. css shaders way go once proper support.
Comments
Post a Comment