delay JQuery effects

前端 未结 6 1681
别那么骄傲
别那么骄傲 2020-11-27 16:07

I want to fade out an element and all its child elements after a delay of a few seconds. but I haven\'t found a way to specify that an effect should start after a specified

6条回答
  •  庸人自扰
    2020-11-27 16:33

    I've written a plugin to let you add a delay into the chain.

    for example $('#div').fadeOut().delay(5000).fadeIn(); // fade element out, wait 5 seconds, fade element back in.

    It doesn't use any animation hacks or excessive callback chaining, just simple clean short code.

    http://blindsignals.com/index.php/2009/07/jquery-delay/

提交回复
热议问题