Jquery 光滑滑块与放大弹出灯箱画廊

Jquery 光滑滑块与放大弹出灯箱画廊,jquery,lightbox,Jquery,Lightbox,我有多个与光滑滑块缩略图图像,我也希望被打开使用一个更大尺寸的图像灯箱画廊 光滑滑块工作良好,灯箱确实打开,但它不会检测到画廊功能。如何编辑当前的放大弹出Jquery,使其能够检测库 jQuery('.popup-gallery').each(function() { jQuery(this).magnificPopup({ delegate: 'a', type: 'image', tLoading: 'Loading image #%c

我有多个与光滑滑块缩略图图像,我也希望被打开使用一个更大尺寸的图像灯箱画廊

光滑滑块工作良好,灯箱确实打开,但它不会检测到画廊功能。如何编辑当前的放大弹出Jquery,使其能够检测库

jQuery('.popup-gallery').each(function() {
    jQuery(this).magnificPopup({
        delegate: 'a',
        type: 'image',
        tLoading: 'Loading image #%curr%...',
        mainClass: 'mfp-img-mobile',
        gallery: {
        enabled: true,
        navigateByImgClick: true,
        preload: [0,1], // Will preload 0 - before current, and 1 after the current image
        arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>', // markup of an arrow button
      }
    });
  });
jQuery('.popup gallery')。每个(函数(){
jQuery(this.magnificPopup)({
代表:“a”,
键入:“图像”,
t加载:“正在加载图像#%curr%…”,
mainClass:'mfp img mobile',
画廊:{
启用:对,
NavigateByMgClick:true,
预加载:[0,1],//将在当前映像之前预加载0,在当前映像之后预加载1
箭头标记:“”,//箭头按钮的标记
}
});
});
下面是我当前代码的一个示例。

使用它可以很好地与slick一起开箱即用

想象一下你有一个复杂的光滑滑块

    $('.yourslider').slick({
     dots: false,
     infinite: true,
     arrows: true,
     slidesToShow: 6,
     slidesToScroll: 1,
     pauseOnHover: false,
     autoplay: false,
     autoplaySpeed: 1000,
     responsive: [
       {
         breakpoint: 1024,
         settings: {
           slidesToShow: 6,
           slidesToScroll: 1,
           infinite: true,
           dots: false
         }
       },
       {
         breakpoint: 600,
         settings: {
           slidesToShow: 4,
           slidesToScroll: 1
         }
       },
       {
         breakpoint: 480,
         settings: {
           slidesToShow: 2,
           slidesToScroll: 1
         }
       }
     ]
     });
然后您只需添加:

$('.yourslider').slickLightbox({
    src: 'src',
itemSelector: 'div img',
navigateByKeyboard  : true,
captionPosition     : 'dynamic',
caption            : 'name'
});
你已经准备好了,这是一个神奇的工具