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 8919985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:09:27+00:00 2026-06-15T06:09:27+00:00

I am currently using javascript to add some animation to a rectangle and once

  • 0

I am currently using javascript to add some animation to a rectangle and once the animation is finished, i set the box to not be displayed. Take a look below for the code to do that.

Javascript

$(document).ready(function() {  
  $(".filled-rectangle").stop().animate({top:'20px'}, 5000).queue(function(next){
    $(".filled-rectangle").css('display', 'none'); 
  });
});  

Now I want to add some more boxes in a container like this,

HTML

<div class="container">
  <div class="filled-rectangle"></div>
</div>

The code above is right now working for one div, .filled-rectangle
I want to add more divs, and use the same animation for all divs.

  • 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-15T06:09:28+00:00Added an answer on June 15, 2026 at 6:09 am

    there are multiple ways.
    you could use nested callbacks which essentially let’s you execute a function after another is completed.
    Since you use a class (“filled-rectangle”) you can select the class in jquery and get an array of all elements with the class attached.
    This array can be used to use each and delay the desired animation for each object, but in this case you can’t use differnt animations for each object it has to be the same.

    Just look at this example -> https://stackoverflow.com/a/4661858/1841875

    In short:

    different animations after another: nested callbacks/queue

    same animation on multiple objects after another: each() with delayed animation

    in your case go with the each-delay-solution 😉

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

Sidebar

Related Questions

I am currently using some javascript to scroll some text on my web page.
I am currently using a email form, which posts some text once the email
I currently have javascript/jquery to 'add and remove' steps from a set of instructions
I'm currently using JavaScript (CommonJS) in Titanium Studio and have a question about prototyping.
I am currently using javascript to implement a javascript scroller on my webpage. However,
I'm currently using inline javascript to clear an input text's default value on focus.
I'm currently using a JavaScript coding style based on Douglas Crockford's Code Conventions for
I am currently using a javascript code to make an entire row in my
Currently we're using javascript new RegExp('#[^,#=!\s][^,#=!\s]*') (see [1]) and it mostly works, except that
I currently am using this JavaScript code snippet to select 3 checkboxes at a

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.