Federico Ferrari Federico Ferrari - 1 year ago 234
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);


Answer Source

Two ways:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download