gpt4 book ai didi

jquery - 带有放大弹出灯箱画廊的光滑 slider

转载 作者:行者123 更新时间:2023-12-01 01:42:32 25 4
gpt4 key购买 nike

我有多个带有光滑 slider 的缩略图,我还想使用灯箱画廊打开它们以获得更大尺寸的图像。

光滑的 slider 效果很好,灯箱确实打开了,但它不会检测到图库功能。如何编辑当前的 Magnific Popup 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
}
});
});

这是一个JSfiddle对于我当前的代码。

最佳答案

使用slick-lightbox开箱即用,而且非常光滑。

想象一下您有一个像这样复杂的光滑 slider ,

    $('.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'
});

你已经准备好了,这是一个了不起的工具!

关于jquery - 带有放大弹出灯箱画廊的光滑 slider ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35392595/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com