davidjerleke / embla-carousel

A lightweight carousel library with fluid motion and great swipe precision.
https://www.embla-carousel.com
MIT License
5.8k stars 175 forks source link

Active option #329

Closed davidjerleke closed 2 years ago

davidjerleke commented 2 years ago

Feature request is related to

Describe the solution you'd like

New option: active: boolean- Useful when used together with the breakpoints option to activate or deactivate depending on media queries.

const options = {
  active: true, // --> 767px screens and down will activate the carousel
  breakpoints: {
    '(min-width: 768px)': { active: false }, // --> 768px screens and up won't activate the carousel
  }
}

const embla = EmblaCarousel(emblaNode, options)
davidjerleke commented 2 years ago

Released with v7.