我有一个运行两个函数的onclick,我希望第一个函数能够运行并完成,并在完成时启动下一个函数。我把它设置像现在这种权利,他们似乎在同一时间运行:有一个功能的jquery在启动另一个功能之前完成
$("#animate_1").click(function() {
update_1_close();
welcome_open();
});
这是两个功能,我不想把它们结合在一起,我有这几条,并结合他们将结束最多是非常复杂的
function update_1_close() {
$("#update_1").animate({
"right": "175px",
"width": "160px"
}, 450);
$("#update_1_caption").animate({
"bottom": "0px"
}, 450);
$("#update_1_img").animate({
"height": "107px",
"width": "160px"
}, 450);
}
function welcome_open() {
$("#welcome_back_1").animate({
"top": "345px"
}, 450);
$("#welcome_header_1").animate({
"top": "35px",
"left": "20px"
}, 450);
$("#welcome").animate({
"height": "270px"
}, 450)
$("#stick_figures").animate({
"top": "215px"
}, 450);
$("#update_1").animate({
"top": "465px",
"right": "175px"
}, 450);
$("#update_2").animate({
"top": "465px"
}, 450);
$("#events").animate({
"top": "645px"
}, 450);
$("#directions").animate({
"top": "645px"
}, 450);
}
你能发布2函数update_1_close和welcome_open? – Ben