gpt4 book ai didi

javascript - 在 fullpage.js 上获取当前幻灯片

转载 作者:行者123 更新时间:2023-11-30 07:55:47 25 4
gpt4 key购买 nike

我是一个快乐的 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);
});

http://jsfiddle.net/168xofn3/11/

最佳答案

三种方式:

关于javascript - 在 fullpage.js 上获取当前幻灯片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39985279/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com