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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:53:51+00:00 2026-05-26T09:53:51+00:00

Im currently creating an application in which user’s are able to drag items to

  • 0

Im currently creating an application in which user’s are able to drag items to a mailbox.

After they drop the item, a new image is created “behind” the mailbox, giving you the feeling it is actually falling in.

Im using the following code to create and animate new images everytime a person drops an item:

function animateDrop(){
animateArray.push($('.animateDrop').clone())
xArray.push(xPos)
yArray.push(yPos)

var foo = animateArray[animateArray.length - 1];
var finalxPos = xArray[xArray.length - 1];
var finalyPos = yArray[yArray.length - 1];

$('body').append(foo);
foo.css({'left': finalxPos, 'top': finalyPos + 40}).fadeIn('slow');
foo.animate({'top': '+=100px'},1500);
};
animateDrop();

When the code is executed the a new image is created, but dropping more items is causing an exponential growth in div’s that are being created.

Somewhere its remembering all of the previously created divs and appends all of them again to the body (atleast that is what is looks like to me).

I am currently stuck on a way to prevent this, any help would be appreciated.

UPDATE 24-10-2011: animateArray.push($(‘.animateDrop’).first().clone())
Adding the .first() to the array push solved the problem of creating multiple 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-05-26T09:53:52+00:00Added an answer on May 26, 2026 at 9:53 am

    Just use jQuery’s first() or :first selector before the cloning call. That should do the trick.

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

Sidebar

Related Questions

I'm currently in the process of creating a Windows service application which will monitor
I have an application which needs to be able to write to Any User/Current
I am currently creating a quote system which works like this: User submits data
Currently I have my application in which I am creating some plist file in
I'm currently creating an application for a customer that will allow them to automatically
I'm currently creating an MVC application that will likely to expand to include a
I am currently in the process of creating an application that records current location
What tecnology should i use? Currently i am thinking of creating a web application
I'm currently in the process of creating a Silverlight 3 data driven application. To
I'm creating an installer for my Windows client application. Currently I create an MSI

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.