如何显示幻灯片的当前和总量--Featherlight.js

时间:2017-03-23 18:32:57

标签: javascript featherlight.js

如何在我的featherlight图库中显示当前幻灯片编号和总幻灯片数?

<div class="thumbnail-gallery" >    
    <a class="gallery" href="#" data-featherlight="#1">
        Image 1
    </a>
    <div id="1" class="lightbox">
        <img src="image.jpg" />
    </div>   
    <a class="gallery" href="#" data-featherlight="#2">
        Image 2
    </a>
    <div id="2" class="lightbox">
        <img src="image2.jpg" />
    </div>  
    // I would like to display slide number and total slide count here
    <p>Image <span class="current-slide">#</span> of <span class="total-slides">#</span></p>
</div>

1 个答案:

答案 0 :(得分:0)

featherlight图库类添加了slides方法,您可以将其用于您的目的。