简体   繁体   English

是否可以获得平滑的过渡,以便按位置对图像进行动画处理?

[英]Is is possible to get a smooth transition animating an image by position?

I am trying to implement a simple query animation on page load, an image (PNG with transparency) moving horizontally across the window which you can see on this page , and which uses this script: 我正在尝试在页面加载时实现一个简单的查询动画,一个图像(具有透明性的PNG)在整个窗口中水平移动,您可以在此页面上看到该窗口,并使用以下脚本:

<script>
$(document).ready(function() {
    $(".logo").animate({"left": "+=900px"}, 3000);
});
</script>

As you will probably see (I have tested in Firefox and Safari) the image judders as it moves across the window. 您可能会看到(我已经在Firefox和Safari中测试过)图像在窗口中移动时会颤抖。 I am wondering if there is a way of making this smoother. 我想知道是否有办法使它更平滑。

Thanks, 谢谢,

Nick 缺口

Welcome to the world of programming for the browser... Ughh 欢迎来到浏览器编程的世界!

As someone here stated, reduce the animation time to like no more than 1000 ms so that the jitteriness is less noticeable. 如此处某人所述,将动画时间减少到不超过1000毫秒,以使抖动不太明显。

You can look into CSS webkit transitions, but those will only work on browsers such as safari and chrome. 您可以查看CSS webkit转换,但这些转换仅适用于safari和chrome等浏览器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM