Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5998229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:22:33+00:00 2026-05-23T00:22:33+00:00

Before with jQuery I could do a chained animation with a delay between like

  • 0

Before with jQuery I could do a chained animation with a delay between like so:

$("#element").delay(45).animate({ }, 45)
             .delay(45).animate({ }, 45)
             .delay(45).animate({ }, 45);

Now since the update to v1.6.1 instead of doing what it did previously, it now skips to the last animation. Ignoring the previous statements. I know I can do an oncomplete callback for each animation but that just get’s messy:

$("#element").delay(45).animate({ }, 45, function(){
    $("#element").delay(45).animate({ }, 45, function(){
        $("#element").delay(45).animate({ }, 45);
    })
}) 

Does anyone know how I can accomplish this in a simple clean way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:22:34+00:00Added an answer on May 23, 2026 at 12:22 am

    Here is the second way as requested. I post it in another answer, because it is more complex, and perhaps less beautiful. To play with it see: http://jsfiddle.net/LMptt/1/

    Usage: use a string with + or – to indicate a relative timestamp. The order matters for relative timestamps (relative to the previous action that is). Use “+0” or ‘-0’ for the same timestamp as the previous one. Absolute timestamps (integers) can be put anywhere in the list.

    $(document).ready(function ()
    {
        queue([
            [2000, function () {  $('.two').slideUp(); }],
            ['-1000', function () {  $('.one').slideUp(); }],
            [3000, function () {  $('.three').slideUp(); }],
            ['+1000', function () {  $('.four').slideUp(); }]
        ]);
    
    });
    
    /**
     * Queue.js
     *
     * @author Arend van Waart
     *
     *  This will allow for events to be queued by (relative) timestamp
     */
    
     function queue (queue){
        var self = this;
        // queue
        this.queue = queue;
        // time passed is 0
        this.timePassed = 0;
        // time in ms to sleep between checks.
        this.sleep = 100;
    
        var time = new Date();
        this.lastTime = time.getTime();
        this.iterate = function(){
            var total = 0;
            var time = new Date();
    
            // how much time has passed since we slept?
            self.timePassed = self.timePassed + (time.getTime() - self.lastTime);
            self.lastTime = time.getTime();
    
            for (var i in self.queue) {
                if (self.queue[i][0] <= self.timePassed){
                    self.queue[i][1]();
                    self.queue.splice(i,1);
                } else {
                    // added sorting now, so we don't have to evaluate the rest.
                    break;
                }
            }
    
            if (self.queue.length == 0){
                return;
            }else{
                setTimeout(self.iterate, self.sleep);
            }
        }
    
    
        this.parseRelative = function ()
        {
            var absoluteQueue = [];
            var lastAbsolute = 0;
            for (var i in queue)
            {
               var absolute;
               var firstChar = String(queue[i][0]).charAt(0);
               if (firstChar == "+" ||  firstChar == "-")
               {
                  absolute = lastAbsolute + parseInt(queue[i][0]);
               } else {
                  absolute = parseInt(queue[i][0]);
               }
               lastAbsolute = absolute;
               absoluteQueue.push([absolute, queue[i][1]]);
            }
            this.queue = absoluteQueue;
        }
        this.sort = function (a,b)
        {
            return a[0] - b[0];
        }
    
        this.parseRelative();
        this.queue.sort(this.sort);
        this.iterate();
    }   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to jquery, and sorry if this question is asked before (could find
before this I wrote all jquery-code into main fail. Now I want to move
In the Jquery example below, I would like to expand $(this) before it is
Before jQuery UI 1.8.4 I could use HTML in the JSON array I built
i've used prototype before, and i'm trying to learn jquery now. The problem: I
Is it necessary to learn JavaScript before jQuery?
At DevDays in SF last year (before jQuery 1.4 was released), I thought they
Never ran into this problem with jQuery before. I have the following: $(document).ready(function() {
You may have seen JavaScript sliders before: http://dev.jquery.com/view/tags/ui/1.5b2/demos/ui.slider.html What I'm envisioning is a circular
Does anyone know how to stop jQuery fromparsing html you insert through before() and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.