jQuery Isotope filtering with Fancybox

后端 未结 2 1929
南笙
南笙 2020-12-17 07:21

I made a Website with a Imagegallery, who is able of beeing filtered with jQuery Isotope. You can click on the thumbnails and then cycle trough the images with the fancybox

2条回答
  •  误落风尘
    2020-12-17 08:12

    It would help to have some code. However, I can show you how I got fancybox to work with the filtered images.

    I'm not using rel=gallery but rather data-fancybox-group=gallery. .fancybox is the class I'm calling fancybox on with the filter string for isotope.

    // filter buttons
            $('#filters a').click(function(){
                  var selector = $(this).attr('data-filter');
              $('#isotopegallery').isotope({ filter: selector }, function(){
                if(selector == "*"){
                 $(".fancybox").attr("data-fancybox-group", "gallery");
                } else{ 
                 $(selector).find(".fancybox").attr("data-fancybox-group", selector);
                }
              });
              return false;
            });
    

    It's all in the filter buttons. Share your code if you can't get it to work.

提交回复
热议问题