FancyBox gallery integration

后端 未结 2 1258
花落未央
花落未央 2020-12-12 02:38

I have a question regarding the integration of FancyBox. I would create a gallery with 10 pictures but only one thumbnail. For example: http://fancyapps.com/fancybox/demo/ T

相关标签:
2条回答
  • 2020-12-12 03:31

    You can simply add display:none to the links you don't want to show.

    e.g. http://jsfiddle.net/MvvuE/

    0 讨论(0)
  • 2020-12-12 03:36

    You need a link to all the images in your gallery regardless they show a thumbnail or not so you may have this html

    <a class="fancybox" rel="gallery" href="image01.jpg"><img src="thumbnail01.jpg" alt="" /></a>
    <a class="fancybox" rel="gallery" href="image02.jpg"></a>
    <a class="fancybox" rel="gallery" href="image03.jpg"></a>
    <a class="fancybox" rel="gallery" href="image04.jpg"></a>
    

    etc. ... in that way, only a single thumbnail is shown and the rest of the links are not visible but functional.

    Then a script like this will fire the gallery

    $("a.fancybox").fancybox();
    
    0 讨论(0)
提交回复
热议问题