-webkit-transition-property 用于翻译
嗨。
CSS3 中翻译的过渡属性是什么?我目前正在使用 all
,但我在 iOS 中遇到了错误,因此我想测试另一个属性。
-webkit-transform: translate(-320px, 0);
-webkit-transition: ??? .5 ease-in-out;
使用 iOS 设备查看该错误此处(水平滑动),有一种闪光。
更新:对于任何感兴趣的人,我通过 Duopixel 找到了解决该问题的方法:
E {
-webkit-transition: all .5s ease-in-out;
-webkit-transform: translate3d(0, 0, 0); // perform an "invisible" translation
}
// Then you can translate with translate3d(), no bug!
document.querySelector('E').webkitTransform = 'translate3d(-320px, 0, 0)'
Hai.
What is the transition property for translations in CSS3? I'm currently using all
but I got a bug in iOS so I want to test another property.
-webkit-transform: translate(-320px, 0);
-webkit-transition: ??? .5 ease-in-out;
See the bug with an iOS device here (swipe horizontally), there's a kind of flash.
Update: to anyone interested, I found a way to fix it thanks to Duopixel:
E {
-webkit-transition: all .5s ease-in-out;
-webkit-transform: translate3d(0, 0, 0); // perform an "invisible" translation
}
// Then you can translate with translate3d(), no bug!
document.querySelector('E').webkitTransform = 'translate3d(-320px, 0, 0)'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有很多东西可以转换,根据我的经验,最容易测试的是不透明度。
不过,我以前也遇到过闪烁的问题,尝试一下:
这会启动硬件加速,从而解决问题并使动画变得极其流畅。
There are tons of things you can transition, the easiest to test in my experience is opacity.
However, I've encountered the flashing problem before, try:
This will kick in hardware acceleration, which fixes the problem and makes the animation extremely smooth.
您的解决方案将起作用,但是您正在寻找的确切答案是 -webkit-transform。
Your solution will work, however it the exact answer you were looking for is -webkit-transform.