-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
I can't seem to figure out how to "reverse" an animation.
Currently, I am trying to use this to open and close a full-screen menu. Opening it works perfectly fine, but creating a second RevealFx with reversed properties breaks the whole thing. (I don't get any errors, but the menu would not open anymore).
I was wondering if there was a way to do the same animation, but in reverse.
main.js:
var mainMenu = document.querySelector("#main-menu");
var menuOpenReveal = new RevealFx(mainMenu, {
layers: 1,
isContentHidden: true,
revealSettings: {
bgColors: ["#1B1C21"],
duration: 600,
delay: 0,
easing: "easeInOutExpo",
direction: "bt",
onStart: function(contentEl, revealerEl) {
contentEl.style.opacity = 0;
},
onHalfway: function(contentEl, revealerEl) {
contentEl.style.opacity = 1;
}
}
});I run the menuOpenReveal.reveal() on click of a button in my header.
Thanks for the library by the way, really love how good and smooth it is! ❤️
Metadata
Metadata
Assignees
Labels
No labels