barbajs / barba

Create badass, fluid and smooth transitions between your website’s pages

Home Page:https://barba.js.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Page content is duplicated when opened

Swimer-MC opened this issue · comments

I am using Codeigniter 4 templates and I am confident that they will work correctly.

demo.mp4

Here's my code:

home.php

<?= $this->extend('templates/base') ?>

<?= $this->section('content') ?>
<a href="/search">go to search</a>
<?= $this->endSection() ?>

search.php

<?= $this->extend('templates/base') ?>

<?= $this->section('content') ?>
<a href="/">go to home</a>
<?= $this->endSection() ?>

templates/base.php

<body>
...
<div data-barba="wrapper">
    <main data-barba="container">
        <?php $this->renderSection('content') ?>
    </main>
</div>
...
<script src="/js/barba.min.js"></script>
<script>
    barba.init({});
</script>

The solution was to move barba.js initialization after vue.js initialization