Skip to content

Update content of certain elements without animating them #624

Answered by hirasso
Fefedu973 asked this question in Help
Discussion options

You must be logged in to vote

Hi @Fefedu973 ! You can exclude elements from your animation by adding your animation class (.transition-main in the following example) to only the elements you want to animate:

<div id="swup">
  <header>This element won't be animated</header>
  <main class="transition-main">This element will be animated</main>
</div>

Alternatively, to get more fine-grained control over which elements to update on page visits, have a look at the containers option:

<div>
  <header id="header">This element won't be animated</header>
  <main id="main" class="transition-main">This element will be animated</main>
  <div>This element will persist through page visits</div>
</div>
const swup = new Swup({
  contai…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Fefedu973
Comment options

Answer selected by Fefedu973
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants