替换发生的褪色不...这是我的代码:为什么我的setTimeout函数fadeOut,用jQuery的replaceWith()不工作延迟替换和淡入文本?
$(document).ready(function() {
var delay = 3000; //3 seconds
setTimeout(function(){
$('.header p').fadeOut(300, function(){
$('.header p').replaceWith("<p>A LIFESTYLE FOR EVERYONE</p>");
});
$('.header p').fadeIn(300);
}, delay);
console.log("replaced");
});
@RoryMcCrossan是啊...立即可见部分使得更有意义 – charlietfl
两个答案同样好!谢谢! –
太滑稽了...接受复制的答案,在这一个之后清楚地张贴了很久 – charlietfl