2

我的投资组合中有一个疯狂的问题: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
4

0 回答 0