简体   繁体   English

超大尺寸-获取上一张/下一张幻灯片的标题?

[英]Supersized - get title of previous / next slide?

Is there a way to get the title of previous or next slide in supersized.js plugin? 有没有办法在supersized.js插件中获取上一张或下一张幻灯片的标题? API allows to get the title only of current slide. API仅允许获取当前幻灯片的标题。

Thanks! 谢谢!

Try this: 尝试这个:

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;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM