title: Fancybox : Changing dynamically data-fancybox-group
body: <p>I have a huge gallery of images with a filter system that's highlight only images that I choose from the filter. So when a I set a filter on my gallery I change dynamically the data-fancybox-group to make a gallery only between the image that I filter but Fancybox seem to don't like it...</p>
  
  <p>So when i switched the filter when I try to click on a images after a filter change the fancybox dosen't work at all. Anybody have a clue on that?</p>
  
  <p>Thanks!</p>
  
  <p>Here is the code of Fancybox :</p>
  
  <pre><code>$(".fancybox").fancybox({
   openEffect : 'fade',
   closeEffect : 'fade',
   prevEffect : 'fade',
   nextEffect : 'fade',
   prevSpeed : 'normal',
   nextSpeed : 'normal',
   arrows : true,
   closeBtn : true
  });
  </code></pre>
  
  <p>Here my filter code :</p>
  
  <pre><code>$(".menu-gallery li a").click(function (){
  
  //My filter menu have a id's
  var thisID = this.id;
  
  //Loop in the gallery to show or hide the filter image with the selected filter
  $(".list-item li div").each(function(){
      if ( $(this).hasClass(thisID) ) {
          $(this).removeClass('hide');
          //Change the data group on the fly to make a gallery only with the selected filter image
          $("a", this).attr('data-fancybox-group',thisID);
      } else {
          $(this).addClass('hide');        
      }
  
  });
  
  });
  </code></pre>