我是一个快乐的Fullpage.js用户!
我只想添加一个类(.num),来显示幻灯片的当前页码/总页数。
我正在使用这个函数,它可以正常工作,但问题是在切换幻灯片时不会更新。
$('.section').each(function(){
var section = $(this),
sectionSlides = section.find('.slide'),
totalItems = sectionSlides.length,
currentIndex = sectionSlides.filter('.active').index() + 2,
numContainer = section.find('.num');
numContainer.html(currentIndex + ' / ' + totalItems);
});
onLeave
或onSlideLeave
。 - Alvaro