【发布时间】:2012-07-17 16:09:31
【问题描述】:
一个简单的翻译动画(在一个小矩形上)在 Android 2.2 浏览器上跳帧,这非常令人惊讶。它甚至不是每秒 10 帧。手机是三星 Galaxy Ace (S5830)。图像上没有其他动画。下面附上代码。我是不是做错了什么,因为我没想到这么简单的翻译动画会这么糟糕。请为一些可接受的平滑度提出任何解决方法
<html>
<head>
<style type="text/css">
#di1, #ci1 {position: absolute;left:0px;top:0px;-webkit-transform-origin: 0% 0%;}
.anim1{
-webkit-animation-duration: 5s;
-webkit-animation-name: animation1;
-webkit-animation-timing-function: linear;
-webkit-animation-iteration-count:1 ;
}
@-webkit-keyframes animation1
{
0%{ -webkit-transform: translate(25px, 25px) }
50%{ -webkit-transform: translate(200px, 00px) }
100%{ -webkit-transform: translate(0px, 200px) }
}
</style>
<script type="text/javascript">
window.addEventListener("load",win_load,false);
function win_load()
{
var c=document.getElementById("ci1");var ctx=c.getContext("2d");
ctx.fillStyle="#ff0000";
ctx.fillRect(25,25,30,30);
}
</script>
【问题讨论】:
-
但仅在一个方向上的动画,即仅在 x 方向或 y 方向上平移的质量是可以接受的。有斜坡的那一刻,所有的地狱都失去了,动画很可悲
-
什么版本的 Android 会变得更好和可以接受
标签: android html css jquery-mobile css-animations