Wanted: Carousel / Slideshow

So sorry to bother you once more …
I was so focused to get the images in that container that I didn’t realise that the js is also not working. I am afraid I’ve put the
<?= js('assets/js/hover-carousel.js') ?>
in the wrong place.

My js file is located in assets–>js and I have placed
<?= js('assets/js/hover-carousel.js') ?>
in my header.php snippet before the </head> tag.

In the footer snippet there is
<script> var carouselElm = document.querySelector('.carousel') new HoverCarousel(carouselElm) </script>
before the </body> tag.

And my home.php looks like this

<?php

snippet('header');

foreach($pages->listed() as $section) {
  snippet($section->uid(), ['data' => $section]);
}

snippet('hover-carousel');
snippet('footer');

?>```


I don’t know if this also goes beyond Kirby support … But I really try to understand how this system works and so I’d be more than happy if you could help me with this one, too.

Is it written exactly like that in your code?

It should be

<script>
var carouselElm = document.querySelector('.carousel');
new HoverCarousel(carouselElm)
</script>

(with a line break before new - and a ; after document.querySelector('.carousel') to be sure)

Yes, it’s written like it should be …

Got it!

snippet('hover-carousel');

doesn’t belong in the home.php.