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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:39:07+00:00 2026-05-30T02:39:07+00:00

I am trying to run the following animation for a set of div elements

  • 0

I am trying to run the following animation for a set of div elements (lets say 50), however, the $.each() function is only working for the first element in the array.

$.each(droplets, function(){
splashVanish(this);
 }); 



  function splashVanish(droplet) {
   droplet.fadeOut(500, function(){
     droplet.css({'top':Math.random()*600+'px','left':Math.random()*1400+'px'});
     droplet.remove();
     $("body").append(droplet);
             //recursive call for infinite animation time
     droplet.fadeIn(500,function(){splashVanish(droplet)}); 
   });
 } 

When the above code runs, only the first div in the array fadesOut, randomizes position and fadesIn for infinite animatiion duration. Sadly, all the other 49 divs are static and not executing the same function.

  • 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-30T02:39:09+00:00Added an answer on May 30, 2026 at 2:39 am

    According to your comment, if droplets is a collection of divs you need to use each() instead. $.each() iterates arrays. Try this and see if it works.

    droplets.each(function(){
        splashVanish($(this));
    }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to run the following function anytime a wordpress Jobs custom post
I am trying to run following code: $a = array('aa'); function my_func (& $m)
Im trying to run the following stored procedure, however it is not giving any
I'm trying to run the following code on a website to set up the
I'm trying to run the following query using phpMyAdmin: UPDATE TABLE x SET `number`
I am trying the following, but cant get the function to run itself again
I'm trying to run the following query: insert into visits set source = 'http://google.com'
I am trying to run the following query, UPDATE candidate_assets SET show = 1
when I trying to run following code. var result = from c in db.brand
Trying to run the following command in php to run powershell command... the following

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.