Closed TanimMahbub closed 2 years ago
swup currently doesn't provide an official way of running both the in and out animations in parallel. The current and the next page's content are never in the DOM at the same time.
You can implement this yourself by hooking into swup's lifecycle events and managing the containers yourself: clone the current container after the transitionStart
event and then remove it after the transitionEnd
event. This will need special care regarding scroll position, absolute positioning, etc.
If you require that feature out of the box, you could check out barba.js which has a sync mode built in.
Thank you so much for the answer, I'll let you know the update when I try to solve it this way.
I'll close this for now as this is more of a question than an issue. Let us know how you managed to implement a synchronous animation, might be useful for later visitors.
We've just released swup 4 which supports parallel animations.
Discussed in https://github.com/swup/swup/discussions/443