Replies: 1 comment 2 replies
-
|
I wonder if this should simply be a new argument to existing Here is a strawman proposal: // basic
container.scrollTo({
left: 'snap-next',
})
// control animation
container.scrollTo({
left: 'snap-next',
behavior: 'smooth'
})
// 2d case
container.scrollTo({
left: 'snap-first',
top: 'snap-first',
behavior: 'instant'
})For an element case you can even use scrollSnapContainer.querySelector('.child-2').scrollIntoView({
block: 'snap',
behavior: 'smooth'
})BTW, something to keep in mind when defining 'previous' and 'next' is that it is possible to have multiple overlapping snap positions coming from different elements. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Context: explainer
Questions?
Thoughts?
Naming fine?
Risks?
Beta Was this translation helpful? Give feedback.
All reactions