delay
will never delay regular methods - only those who are pushed to the animation/effect chain. If you want to delay your html()
call, use queue
( http://api.jquery.com/queue/ ):
$('#error_box_text').html('error text').delay(5000).queue(function() {
$(this).html('')
});
It would be nice if you could do
$('#error_box_text').html('error text').delay(5000, function() { $(this).html('') });
but this isn't possible (yet).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…