$("#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
)时失去了控制。有没有人能告诉我代码看起来是否正常,或者我确实在所有的){){{)){
中迷路了
发布于 2013-06-26 17:35:30
我看不出你的代码有什么问题,所以我猜问题出在别的地方。确保#info001
有某种可以接受宽度和高度的布局(例如,用block
代替inline
)。
发布于 2013-06-26 17:41:24
尝试在.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');
https://stackoverflow.com/questions/17316176
复制相似问题