触摸事件在动画关键帧 CSS IOS 14 中不起作用
我尝试在动画内容向左运行时阻止按住拖动,以便使用触摸动作时动画不会卡住,但是当我在 IOS 14 Webview 中测试时,触摸-action 似乎无法正常工作。有什么见解吗?
.wrapper {
position: relative;
width: 300px
height: 100vh;
}
.content-box {
display: flex;
justify-content: center;
align-items: center;
width: 300px;
height: 500px;
background: green;
animation: ctl-noTouch 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}
@keyframes ctl-noTouch {
0% {
transform: translateX(40px);
touch-action: none;
}
99% {
transform: translateX(0px);
touch-action: none;
}
100% {
transform: translateX(0px);
touch-action: auto;
}
}
<div class='wrapper'>
<div class='content-box'>
Content to left
</div>
</div>
I try to prevent hold drag when animation content to left is running so the animation not stuck using touch-action, but when i test in IOS 14 Webview, touch-action seem not working properly. Any insight?
.wrapper {
position: relative;
width: 300px
height: 100vh;
}
.content-box {
display: flex;
justify-content: center;
align-items: center;
width: 300px;
height: 500px;
background: green;
animation: ctl-noTouch 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}
@keyframes ctl-noTouch {
0% {
transform: translateX(40px);
touch-action: none;
}
99% {
transform: translateX(0px);
touch-action: none;
}
100% {
transform: translateX(0px);
touch-action: auto;
}
}
<div class='wrapper'>
<div class='content-box'>
Content to left
</div>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论