Skip to content
Discussion options

You must be logged in to vote

Hi @ravenaxiom,

Thank you for your question. The slidesToScroll option will group slides into the given integer. It won't do any checks if the slides fit into the viewport or any other checks for that matter. So as you mention, you'll have to write that logic yourself if you want it to be handled automatically.

slidesToScroll is easier to use with relative slide sizes which basically means setting you slide sizes in %. Let's say you want to scroll 2 slides on desktop and 1 on mobile, you can do it like this:

.embla__slide {
  flex: 0 0 100%; /* Default slide covers 100% of the viewport */
}
@media (min-width: 768px) {
  .embla__slide {
    flex: 0 0 50%; /* Breakpoint SM slide covers 50% …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ravenaxiom
Comment options

@davidjerleke
Comment options

@davidjerleke
Comment options

Answer selected by davidjerleke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants