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

  • Home
  • SEARCH
  • 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 8953537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:07:06+00:00 2026-06-15T14:07:06+00:00

I have a variable number of asynchronous events that I want execute. I want

  • 0

I have a variable number of asynchronous events that I want execute. I want to be able to take some further action after they have ALL completed.
The code snippet below shows my attempt at calling the events using the jquery deferred object.. Could anyone help? (I know the code won’t run as is). bubble.transitionTo is the async event. The alert(‘complete’); is called before the async callbacks have been complete, in fact before they are executed.

var events = [];
    for (var i = 0; i < stageBubbles.length; i++) {
        var element = stageBubbles[i];
        var bubble = new Object();
        bubble = this.dataPointLayer.get('#' + element.name)[0];
        bubble.setOpacity(0.5);
        events.push(bubble.transitionTo({
            x: element.x,
            y: element.y,
            radius: element.radius,
            duration: 3,
            easing: 'ease-in',
            callback: function () {

            }
        }));
    }
    $.when.apply(this, events).done(function () { alert('complete'); });
  • 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-06-15T14:07:07+00:00Added an answer on June 15, 2026 at 2:07 pm

    where is this transitionTo function defined? I can’t find it in any of the jQuery project’s documentation. The likelyhood is that it doesn’t implement the $.Deferred methods.

    If my assumption is correct you could try something like this.

     showBubbles = function (stageBubbles) {
            var events = [],
                deferred = $.Deferred(),
                completedCount = 0;
    
            for (var i = 0; i < stageBubbles.length; i++) {
                var element = stageBubbles[i];
                var bubble = new Object();
                bubble = this.dataPointLayer.get('#' + element.name)[0];
                bubble.setOpacity(0.5);
                bubble.transitionTo({
                    x: element.x,
                    y: element.y,
                    radius: element.radius,
                    duration: 3,
                    easing: 'ease-in',
                    callback: function () {
                        completedCount += 1;
                        if (completedCount == stageBubbles.length) {
                            deferred.resolve();
                        }
                    }
                });
            }
            return deferred.promise();
        };
        $.when(showBubbles.call(this, stageBubbles)).done(function () { alert('complete'); });
    

    This function returns a deferred object that resolves when the callbacks have been called for all your bubbles.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have strings that contain a variable number of leading hyphens and which may
I have a PHP function that takes a variable number of arguments (using func_num_args()
I have an app that creates a variable number of ScatterviewItems based on which
I have a function that accepts a variable number of parameters: foo (Class... types);
I have a datagrid with a variable number of columns that I am generating
I have a form that has 8 columns and a variable number of rows
I have a variable number of rows in a mysql table. I want to
I have a variable number of ArrayList's that I need to find the intersection
Suppose I have a variable number of static image resources that I would like
Hi I have the following requirement. I want to create variable number of String

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.