Multiple Fancybox 2 Galleries issue with “rel”

后端 未结 1 504
忘掉有多难
忘掉有多难 2020-12-21 16:40

I\'ve seen some questions that address similar issues but none of the fixes seem to work for my situation. Basically I have multiple fancybox galleries on one page throughou

1条回答
  •  旧巷少年郎
    2020-12-21 17:13

    This part of your code :

    $(".fancybox")
        .attr('rel', 'gallery')
        .fancybox({
        .... etc
    

    ...is overriding the rel attributes in your html. Just remove the .attr() method from it like :

    $(".fancybox")
        .fancybox({
        .... etc
    

    ... and you will be fine.

    0 讨论(0)
提交回复
热议问题