2013-06-26 59 views
0
$("#page1 .textblock.hidden").fadeIn('fast').animate({ 
    'marginTop': textblockpan - ($("#page1 .textblock").height()/2), 
}, 1500, function() { 
    $(".title").fadeIn(500, function() { 
     $("#building").animate({ 
      width: "147px", 
      height: "147px" 
     }, 1000, function() { 
      $("#info001").animate({ 
       width: "147px", 
       height: "147px" 
      }, 1000) 
     }); 
    }); 
}).removeClass('hidden').addClass('visible');  

发现一个好的起始码为一些jQuery效果和教训here你应该如何让经过另外一个jQuery的效果开始。上面的代码工作正常:我的文本块动画,标题淡入,#building股利变得更大。所以前三种效果以正确的顺序出现。但似乎是我失去控制插入第四个效果(动画#info001)。有人可以告诉我,如果代码看起来不错,或者确实我在所有的){){{)){中迷路了吗?jQuery的动画动画效果后生效,之后动画效果

回答

1

我不能发现你的代码有什么问题,所以我猜这个问题在其他地方。确保#info001具有某种可以采用宽度和高度的布局(例如,block而不是inline)。

+0

谢谢德里克,的确,我的解决方案/错误是在CSS中。感谢您的反馈!!! –

0

尝试在.animate()的前面添加.stop()并查看。

$("#page1 .textblock.hidden").fadeIn('fast').animate({ 
    'marginTop': textblockpan - ($("#page1 .textblock").height()/2), 
}, 1500, function() { 
    $(".title").fadeIn(500, function() { 
     $("#building").stop().animate({ 
      width: "147px", 
      height: "147px" 
     }, 1000, function() { 
      $("#info001").stop().animate({ 
       width: "147px", 
       height: "147px" 
      }, 1000) 
     }); 
    }); 
}).removeClass('hidden').addClass('visible');