Replies: 1 comment
-
It is already possible to combine splide with glightbox or photoswipe - [...]
<li class="splide__slide">
<a href="https://picsum.photos/seed/b/1920/1080" class="glightbox" data-type="image">
<div class="imgwrap">
<img src="https://picsum.photos/seed/b/800/450" alt=""/>
<div class="copy">
<div class="trigger">©</div>
<div class="data">my copyright</div>
</div>
</div>
</a>
</li>
[...] You just have to initialize the lightbox then, which can update the slider position, too! const mainSlider = new Splide( '#primary-slider', {
type : 'fade',
arrows : false,
speed : 555
} );
mainSlider.mount();
const lightbox = GLightbox({
loop: true,
openEffect: 'fade',
closeEffect: 'fade',
width: 1920,
height: 1080
});
lightbox.on('slide_changed', ({ prev, current }) => {
// Update position of the slider
mainSlider.go( current.index );
});
} ); HTH |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
it is possible to combine splide picture gallery with a lightbox effect or combine with a lightbox library (eq. fresco)?
I would like to make it possible for the user to start an enlarged view by clicking on the image carousel. And for this use case I want combine the image carousel with a lightbox function.
Thanks in advance,
Dirk
Beta Was this translation helpful? Give feedback.
All reactions