Hello, I have a little problem understanding the function of reverse TimelineLite.
If someone has 5 minutes to help me understand, would be nice.
$('#plop').on('click', function() {
$(this).toggleClass('is-open');
// Animation
var animNav = new TimelineLite({
paused: true
});
animNav.to('#nav', 0.2, {
x: 100,
opacity: 1,
ease: Sine.easeInOut
})
.staggerTo('.nav-link', 0.1, {
opacity: 1,
ease: Sine.easeInOut
}, '0.1', '-=0.15');
if ($(this).hasClass('is-open')) {
animNav.play();
} else {
animNav.reverse();
}
return false;
});