Skip to content

Remount Progress bar after breakpoint destroy #1189

Closed Answered by katwlodarczyk
katwlodarczyk asked this question in Q&A
Discussion options

You must be logged in to vote

Ok so i was passing a slider into the function progressBar, and I shouldn't have.
Here is a working code:

import "@splidejs/splide/css";

import Splide from "@splidejs/splide";

document.addEventListener("DOMContentLoaded", () => {
    let blocks = document.querySelectorAll(".block_reviews");

    blocks.forEach((block) => {
        let slider = new Splide(block, {
            type: "slide",
            snap: true,
            focus: "start",
            padding: "24px",
            gap: "32px",
            perPage: 1.25,
            autoWidth: true,
            mediaQuery: "min",
            breakpoints: {
                768: {
                    destroy: true,
                },
     …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by katwlodarczyk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant