有没有办法在supersized.js插件中获取上一张或下一张幻灯片的标题? API允许仅获取当前幻灯片的标题。
谢谢!
答案 0 :(得分:0)
试试这个:
var currentSlide = vars.current_slide, // zero-based index
slides = api.options.slides,
totalSlides = slides.length - 1,
nextSlideTitle = api.options.slides[ (currentSlide + 1 < totalSlides) ? currentSlide + 1 : 0 ].title,
prevSlideTitle = api.options.slides[ (currentSlide - 1 > 0) ? currentSlide - 1 : totalSlides ].title;