I'm using a Flickity carousel in my website and I found the piece of code (link below) that allows me to see the slide number and length.
https://codepen.io/desandro/pen/dpPzab
After placing that in my website it didn't work and I get this message in the console "ReferenceError: Can't find variable: Flickity"
Code:
window.onload = (function(){
var $carousel = $('.carousel').flickity();
var $carouselStatus = $('.carousel-status');
var flkty = $carousel.data('flickity');
function updateStatus() {
var cellNumber = flkty.selectedIndex + 1;
$carouselStatus.text( cellNumber + '/' + flkty.slides.length );
}
updateStatus();
$carousel.on( 'change.flickity', updateStatus );
Can you give me a hand? here you can find the page (still in progress) where I have the carrousel https://crvlh.com/work/brand-identity-la-fete/