- delay方法代表延迟,在动画执行完毕之后,执行延迟函数,在延迟之后再执行之后的动作。delay传入一个参数,该参数为延迟的时间
$(".one").animate({
width: 300
}, 2000).delay(2000)
$(".one").animate({
height: 300
}, 2000)
- stop方法为停止动画的执行
//停止当前动画,继续执行后续的动画
$("div").stop()
$("div").stop(false)
$("div").stop(false, false)
//停止当前和后续所有动画的执行
$("div").stop(true)
$("div").stop(true, false)
//完成当前动画,继续执行后续动画
$("div").stop(false, true)
//完成当前动画,停止执行后续动画
$("div").stop(true, true)