How to update the w--current class in Webflow after the page loads using Swup? #568
-
I making my new webflow website and I am implementing swup.js. Everything works fine, except when I try to animate the current state of a nav link. Since I am using Swup to handle all transitions, when a click on a nav link and go to a different page, the w--current class that Webflow automatically adds to the current page, does not do that anymore. I tried reading the docs but couldn't solve this issue. My current swup code is just: (via script) const swup = new Swup(); Anyone can help? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You can use the morph plugin for that type of thing. It will carry over any changed classnames and attributes. Assuming your content is in const swup = new Swup({
containers: ['#content']
plugins: [
new SwupMorphPlugin({ containers: ['#nav'] })
]
}) |
Beta Was this translation helpful? Give feedback.
You can use the morph plugin for that type of thing. It will carry over any changed classnames and attributes. Assuming your content is in
#content
and you nav is in#nav
: