Skip to content

Responsive (mount at mobile / unmount at desktop) #827

Answered by brandonpeat
brandonpeat asked this question in Q&A
Discussion options

You must be logged in to vote

Well, apparently 5 more minutes of searching the docs would have solved it! For any developers Googling here from the future:

Splide allows you to flip the query behavior with the mediaQuery property: https://splidejs.com/guides/options/#mediaquery

The default is the desktop-first max-width, so just specify min and it'll be mobile-first as God intended:

mediaQuery: 'min',
breakpoints: {
  1024: {
    destroy: true,
  },
  767: {
    perPage: 2,
  }
}

These days it seems like min should be default, but I'm going to guess that's at least partially due to supporting legacy implementations when desktops were first and/or only.

Cheers to the Splide team -- enjoy the egg on my face.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hypeJunction
Comment options

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