NickPiscitelli/Glider.js

Can I put breakpoint based on specific <div> width rather than complete page?

nocodetalks opened this issue · 1 comments

new Glider(reviewList, {
      slidesToShow: 1,
      slidesToScroll: 1,
      draggable: true,
      dots: ".dots",
      arrows: {
        prev: ".glider-prev",
        next: ".glider-next",
      },
      responsive: [
        {
          // screens greater than >= 768px
          breakpoint: 768,
          settings: {
            // Set to `auto` and provide item width to adjust to viewport
            slidesToShow: 2,
            slidesToScroll: 1,
            duration: 0.25,
          },
        },
        {
          // screens greater than >= 992px
          breakpoint: 992,
          settings: {
            slidesToShow: 3,
            slidesToScroll: 1,
            duration: 0.25,
          },
        },
        {
          // screens greater than >= 1200px
          breakpoint: 1200,
          settings: {
            slidesToShow: 4,
            slidesToScroll: 1,
            duration: 0.25,
          },
        },
      ],
    });

Right now its working on the current page width.

How can I specify that the breakpoint works on the width of the specified div, rather than the whole page?

No, unfortunately this is not possible. You could patch it in rather easily though