Hi
I’m using Nja plugin this Barba.js wich is a PJAX Jquery plugin. The logic is to call every functions twice, on DOM ready and on a callback when Barba loads the new content. But I can’t making work Nja because the setup defines a function called inside the footer and a script called without async…
Sorry for this JS-oriented question but do you have some advices ?
<?php echo js('assets/js/myscript.js', true) ?>
<?php echo js('assets/plugins/kirby-nja/js/dist/script.min.js'); ?>
<script>
nja.init({root: '<?php echo u(); ?>'});
</script>
And the Barba.js Callback is :
Barba.Dispatcher.on('transitionCompleted', function(currentStatus, oldStatus, container) {
// If I put Nja.init here, the click button is working
// but it return to the previous value every 4 seconds
// as mentionned in the timeout section from the Nja documentation
});