jQuery: append() object, remove() it with delay()

前端 未结 4 1494
被撕碎了的回忆
被撕碎了的回忆 2020-12-01 06:09

what\'s wrong with that?

$(\'body\').append(\"
Upload successful!
\"); $(\'.message\').delay(2000).remove(); <
4条回答
  •  遥遥无期
    2020-12-01 06:47

    I think that correct way of doing that is to use jQuery queue method:

        $("
    Upload successful!
    ") .appendTo('body') .delay(2000) .queue(function() { $(this).remove(); });

提交回复
热议问题