admin管理员组文章数量:1296907
I have a snap-y snap-mandatory overflow-y-scroll
container with several items inside. The snap is working, but I don't like how the snap is animated.
Is there any way to control the animation of the snap?
I had hoped that transitions might offer some control over this, but (unless I'm misunderstanding something) it seems that transitions are really meant for items entering or leaving the DOM.
I'm using Svelte and TailwindCSS; so, if either of these libraries provide an easy way of doing this, please let me know. If it's only possible to achieve this by writing something from scratch, I'll probably just leave it be.
I have a snap-y snap-mandatory overflow-y-scroll
container with several items inside. The snap is working, but I don't like how the snap is animated.
Is there any way to control the animation of the snap?
I had hoped that transitions might offer some control over this, but (unless I'm misunderstanding something) it seems that transitions are really meant for items entering or leaving the DOM.
I'm using Svelte and TailwindCSS; so, if either of these libraries provide an easy way of doing this, please let me know. If it's only possible to achieve this by writing something from scratch, I'll probably just leave it be.
Share asked Feb 11 at 16:56 Mackie MesserMackie Messer 1,3282 gold badges11 silver badges24 bronze badges 01 Answer
Reset to default 1As you noted, Svelte's transitions deal with elements being added/removed.
The scroll snap animations are controlled by the browser and there does not seem to be a way to affect the animation itself. There is the scroll-behavior
property but that does not have many options and none that would affect scroll snapping.
本文标签: javascriptIs there anyway to control the snap animation using Svelte or TailwindCSSStack Overflow
版权声明:本文标题:javascript - Is there anyway to control the snap animation using Svelte or TailwindCSS? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741646185a2390196.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论