Execute scroll reset during out animation #943
-
Describe your problem 🧐Hello SWUP community! While working on a recent project, I have a question about whether it’s possible to execute the scroll during the first part of the OUT animation so that the scroll trigger animations don’t execute on the way up. The sequence I’m looking for is animate out > scroll to top > destroy scroll trigger animation to reset them > animate in. Currently, it works for me as animate out > destroy scroll triggers > scroll > animate in, and the animation doesn’t reset properly. What is your question? 🙋♀️I’m leaving a link with a small deployed demo. On the first load, you’ll see that all the animations trigger correctly as you scroll, but if you click on a link card in the “More Trend Stories” section at the bottom of the page, all the animations trigger during the transition and then don’t work when scrolling down again. You can observe in the console that the console.log for the destroy scroll triggers executes right before SWUP scrolls to the top. I’ve also tried using SwupScrollPlugin with doScrollingRightAway: true, but it scrolls right before the animation starts. this.swup.hooks.on("content:replace", () => {
this.contentReplaced();
});
this.swup.hooks.before("content:replace", () => {
this.willReplaceContent(); //Here is where I execute all animation reset
}); Can anyone lend me a hand? Thanks! URL to minimal reproduction 🔗https://stage--axa-future.netlify.app/ai-automation/ Checked all these? 📚
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
hey @daun could you advise on this item? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the heads up! we were able to fix the issue on our own. Enjoy your vacation! 😊
out: (next, infos) => {
|
Beta Was this translation helpful? Give feedback.
Thanks for the heads up! we were able to fix the issue on our own. Enjoy your vacation! 😊
out: (next, infos) => {