Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

228
Views
Why does page content not change with Swup Transition?

I am trying just a simple project in which the pages have a transition using Swup (https://swup.js.org/getting-started/example), but I can't get it working.


If I click on the Link the URL is changing, but the Content stays the same, from subpage.html I can change to index.html, but there are no transitions in all cases.
<a href="/subpage.html">Other Page</a>

[Right URL but wrong Content][1]


This is all the HTML, CSS & JS:

<body>

  <style>
    .transition-fade{
      transition: 0.5s;
      opacity: 1;
    }

    .html.is-animating .transition-fade{
      opacity: 0;
    }
  </style>
  
  <div class="container">

    <main id="swup" class="transition-fade">
      <h1>homepage</h1>
      <p>Lorem ipsum dolor sit amet.</p>
      <a href="/subpage.html">Other Page</a>
    </main>
  </div>

  <script src="/node_modules/swup/dist/swup.min.js"></script>
  <script>
    const swup = new Swup();
  </script>

</body>

And this is the HTML on subpage.html:

<body>

  <style>
    .transition-fade{
      transition: 0.5s;
      opacity: 1;
    }

    .html.is-animating .transition-fade{
      opacity: 0;
    }
  </style>
  
  <div class="container">
    <main id="swup" class="transition-fade">
      <h1>Supage</h1>
      <p>Lorem ipsum dolor sit amet.</p>
      <a href="/index.html">Homepage</a>
    </main>
  </div>

</body>

Please help me, what am I doing wrong?
[1]: https://i.stack.imgur.com/dbq3E.png

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!