如何平滑jquery动画 [英] how to smooth jquery animations

查看:107
本文介绍了如何平滑jquery动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想平滑一些jquery.animate函数的链接。

I would like to smooth the chaining of some jquery.animate functions.

这是一个jsfiddle我描述的问题:
http://jsfiddle.net/xavier_seignard/KTxbb/4/

Here is a jsfiddle where I describe the problem : http://jsfiddle.net/xavier_seignard/KTxbb/4/

正如你所看到的,每个动画之间都有一个停止,即使是线性属性。

As you can see, there is a stop between each animation, even with the linear attribute.

你对如何平滑它有什么想法吗?或其他任何可以解决问题的方法?

Do you have any idea about how to smooth it? Or anything else that would do the trick?

问候

推荐答案

你可以改变一个更精细动画的速度,你会看到停止,因为它的速度太快而且尺寸不同:

You can change the speed for a more "fine" animation, you see that stop because the speed it's too fast and different size to cover:

function initPage() {
    $.each(json, function() {
        $("#point").animate({
            left: this.x,
            top: this.y
        },
        1000, 'linear');
    });
}​

这篇关于如何平滑jquery动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆