Please see Matt’s answer to this question. He says that .delay() is confusing to most people, and he gives the following example:
$('#foo').hide().delay(2000).slideDown().text('Hello!').delay(2000).hide();
See here for the fiddle. Could somebody explain the behaviour of that line of code?
Only certain parts of jQuery’s code can be pushed off with
.delay()—hide()andtext()are not a part of that group.So basically what the code is doing is (not really doing this, this is just a sketch):
So that is why the
slideDown()seems to happen last.