jQuery Isotope filtering with Fancybox

后端 未结 2 1904
南笙
南笙 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 07:56

    I tried doing it the way ellenmva explained, but couldn't get it to work. I ended up removing the $('#isotopegallery').isotope({ filter: selector }, function() part. So what I was left with was:

    $('.filterbutton').on("click", function(){
        var selector = $(this).attr('data-option-value');
        if(selector == "*"){
            $(".fancybox").attr("data-fancybox-group", "gallery");
        } else{ 
            $(selector).find(".fancybox").attr("data-fancybox-group", selector);
        }
       return false;
    });
    

    That seemed to do the trick, it now works just fine.

提交回复
热议问题