我的投资组合中有一个疯狂的问题:http://hericdk.com 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