I have strange problem with the delay function here using the HTML function with it.
I set an HTML text by using $( '#element').html( 'Hello World');
After setting the text I want to get this text disappear in 3 seconds.
So next line I wrote:
$('#element').delay( 3000).html( ' ');
This one doesn't work, it sets the HTML to  
without waiting the 3 seconds, it looks like jQuery is skipping the delay function. Using this with fadeOut for example works fine. I guess this has something to do with this queue thing in delay.
But why doesn't this work. Its a pretty simple, wait 3 seconds then run the HTML function.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…