当我更改浏览器选项卡时,Jquery Animate停止

时间:2012-06-08 20:08:23

标签: jquery animation jquery-animate sprite

我的投资组合中有一个疯狂的问题:http://hericdk.com

我用jquery制作了一个简单的动画,一个太空船飞行的动画,然后它看起来像我的作品,这个想法很好,每个人都喜欢,但问题是因为一些奇怪的原因,当我点击看我的项目和船开始飞,如果我更改浏览器选项卡然后返回,所有背景动画正常工作..但船的动画仍然等待动画的下一个动作,直到我返回到选项卡我的投资组合

我会把太空船的动画代码放在这里,大家都明白了。

$('#spaceship a').click(function(){
    $('#spaceship').spState(2).sprite({fps: 9, no_of_frames: 12});
    $('#space').stop().delay(3000).animate({'top':'0px'},9000,'easeInOutQuad');

$('#spaceship').animate({'top':'150px','left':'55%'},3000,'easeInOutExpo').delay(200)
    .animate({'top':'350px','left':'65%'},2000,'easeInOutExpo').delay(100)
    .animate({'top':'-400px','left':'65%'},1300,'easeInBack').delay(100)
    .animate({'top':'-400px','left':'88%'},300,'easeInBack').delay(3000)
    .animate({'top':$(window).height()-305+'px','left':'88%'},4000,'easeOutQuad',function(){
    $('#spaceship').spState(1).spStop(true);


    });// spaceship launch

    return false;       
}); //spaceship animation

0 个答案:

没有答案
相关问题