Federico Ferrari Federico Ferrari - 9 days ago 8x
jQuery Question

Get current slide on fullpage.js

I'm a happy Fullpage.js user!

I just would love to add a class (.num) that shows the current number of slide / the total number of slides.

I'm using this function that works fine, the problem is that it doesn't update at slide change.

var section = $(this),
sectionSlides = section.find('.slide'),
totalItems = sectionSlides.length,
currentIndex = sectionSlides.filter('.active').index() + 2,
numContainer = section.find('.num');

numContainer.html(currentIndex + ' / ' + totalItems);



Two ways: