Search code examples
jquerydelay

jQuery .delay() not working in Chrome, but fine in IE


I was making some stuff and afterwards I noticed the delay function was working fine in IE, but doesn't do anything in Chrome and I really don't know why. It is really basic stuff. So before I start changing everything to setTimeout functions I would like to ask for advice.

Many thanks in advance!

$(document).ready(function() {

    $("#start").width(0);
    $("#start").delay(1000).animate({
        width: '280px'
    }, 750);

    $("#info").delay(2500).fadeIn(5000);

    $("#in").delay(1250).fadeIn(1000);
    $("#plusmin").fadeIn(2000);

    $('#arrow').delay(2000).fadeIn(4000);
});​

Solution

  • Example: http://jsfiddle.net/xwVF6/

    Works fine in my Chrome V23.

    Make sure you don't have multiple of the same ID's, and are using a newer jquery version (newer that 1.3 which is when delay was added).

    Else please provide some HTML ;-)

    SetTimeout() might be better if you are making dependent animations (show A, then show B 0.5 seconds after A etc).