$("#div_id").click(function() {
    $(this).effect("shake", { times:3 }, 300);
    // Here I want wait that the div_id can complete its shake
    alert('hello');
  }


.delay我试过了,但是没有用。

最佳答案

$(this).effect("shake", { times:3 }, 300, function() {

    // this will alert once the animation has completed
    alert('hello');
});

关于javascript - 如何等待Java代码行的执行?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5790501/

10-09 18:44