title: Magnific pop-up synchronized with slider
body: <p>Just wondering if it is possible to synchronize Magnific pop-up with a slider(flexslider or slick, for example) so that when you change slide on Magnific pop-up the slider in the background also changes.</p>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>$('.slick-slider').magnificPopup({
      delegate: '.slides:not(.slick-cloned) a',
      type: 'image',
      mainClass: 'mfp-fade',
      fixedContentPos: false,
      removalDelay: 350,
      pauseOnHover: false,
      gallery:{
          enabled: true,
          tCounter: '&lt;span class="mfp-counter"&gt;%curr% of %total%&lt;/span&gt;'
      },
      callbacks: {
          beforeClose: function() {
              $('.slick-slider').slick('slickGoTo', parseInt(this.index - 1));
  
             // works better with the code bellow but sometimes gets stuck between 2 slides 
             $('.slick-slider').slick('slickGoTo', parseInt(this.index));
  
          }
      }
  });
  </code></pre>