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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:33:16+00:00 2026-05-26T22:33:16+00:00

I am working on some animation and am using the jQuery library. One of

  • 0

I am working on some animation and am using the jQuery library.

One of the assets’ method is fly(), which means to fly away from the parent element had that parent just exploded. It should look like flying debris, i.e. it should fly up and away and then succumb to gravity and fall. Example.

Here is my method so far…

var parent = this.element.parent(),
    direction = this.element.position().left < parent.width() / 2 ? '-' : '+';

this.element.animate({
    left: direction + '=300',
    top: '-=200'
}, duration);

This obviously doesn’t look at all like flying debris, as it just moves up and away. The direction variable determines which way the element should fly. Because each element is relatively positioned to its parent, elements on the left hand side move to the left and vice versa.

I’d don’t want to implement a full fledged physics engine such as Box2D.

I know what my code should essentially do, which I believe is…

  1. Fly the elment up (negative top) and in the direction set (negative or positive left), with some value decaying to simulate loss of horizontal movement due to wind resistance etc and loss of vertical movement due to gravity.
  2. The force of gravity will have grown stronger at some stage than the upward force of the element from the explosion, in which case the element will need to fall.

I don’t really know how to approach this problem. I was hoping I could leverage jQuery’s animate(), but I don’t know to incorporate a decaying value.

What would be the best way to create this effect?

  • 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-26T22:33:16+00:00Added an answer on May 26, 2026 at 10:33 pm

    (I will post this as an answer since that’s what it actually is.)

    Do you just need a debris animation for eye candy, or does it have to be precisely calculated? I found that using random values can actually make it realistic. See http://jsfiddle.net/minitech/fSaGk

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

Sidebar

Related Questions

I have added some animation using jquery but it's not working: $('.test-container').click(function(){ $(this).css('background-color', 'rgb(119,
I'm trying to achieve some animation using jQuery. I have it working but I'm
I am using frame animation for displaying some images. But it's working only in
I'm using jQuery , fancybox and vgrid library(http://blog.xlune.com/2009/09/vgrid/demo007.html) I want to achieve some sequential
Working on some tweaks for a build script, I noticed that the output from
I'm working on some production software, using C# on the .NET framework. I really
I'm working with some Core Animation for the first time and in the process
i have faced some problem while navigating from one class to another with the
I'm trying to do very basic, custom animation with JavaScript. I'm using a library
I am using jQuery slider to browse images and Scriptaculous slider animation on the

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.