Closed eformx closed 7 months ago
chatGPT to the rescue :)
$(document).ready(function (e) {
var splide = new Splide( '.splide', {
type : 'loop',
snap : true,
direction : 'ttb',
height: '90vh'
});
splide.mount();
// Function to log the data-slide attribute of the active slide
function logActiveSlide() {
var activeSlide = splide.Components.Elements.slides[splide.index];
var slideData = activeSlide.getAttribute('data-slide');
console.log(slideData);
}
// Log the initial active slide
logActiveSlide();
// Listen for the moved event (triggered when the user hits the previous and next slide buttons)
splide.on('moved', logActiveSlide);
});
Hi,
with the option perPage: 2 two slides are displayed per move. how can i read out the html elements here. only the first one is displayed.
Checks
Version
v4
Description
How do I get the data attribute, for example slide2? I have tried pagination moved and can't get the attribute. Javascript of Jquery solution?
Reproduction Link
https:
Steps to Reproduce
see above
Expected Behaviour
return slide1 or 2 or 3