这是我的功能:
function showGeneralWarning(msg) {
if (getIDQuantity("generalWarning") < 1) {
$("#Warnings").append('<p id="generalWarning" class="alert alert-danger" style="display: none;">' + msg + '</p>');
$("#generalWarning").fadeIn('slow').animate({opacity: 1.0}, 100).effect("pulsate", { times: 5 }, 1000);
$("#generalWarning").fadeOut('slow').animate({opacity: 1.0}, 100).effect("pulsate", { times: 5 }, 1000);
}
}
它完美地淡入,但它永远留在那里(它永远不会淡出并消失)。
最佳答案
这是一个简单的例子,希望它是您想要的
$('.fadein').hide().fadeIn('slow').delay(800).fadeOut('slow');
https://jsfiddle.net/3spc9541/
有关链接的更多信息 http://www.w3schools.com/jquery/jquery_chaining.asp
关于javascript - 如何在段落淡入后立即淡出该段落?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34002143/