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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:51:43+00:00 2026-06-03T17:51:43+00:00

Suppose I have some div, and I use .animate({opacity:0},400, function(){}); for its children. Is

  • 0

Suppose I have some div, and I use .animate({opacity:0},400, function(){}); for its children.
Is it ever possible then to get the remaining time for an animation to complete? eg, 200 ms remaining, or 0 if there’s no animation?
Thanks.

  • 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-03T17:51:47+00:00Added an answer on June 3, 2026 at 5:51 pm

    To help you better understand how you can use the step function
    [as posted by gdoron]
    I created an example using the step function to get the remaining time:

    (click the get state! button to stop the animation and retrieve the remaining time!)

    demo with distance
    demo with opacity

    Distance example jQuery:

    var time = 4000;
    var distance = 300;
    var currentTime = 0;
    
    $('#ball').animate({
        left: distance
    }, {
        duration: time,
        step: function (now, fx) {
    
            currentTime = Math.round((now * time) / distance);
            var data = fx.prop + ' ' + Math.round(now) + '; <b>' + currentTime + 'ms</b> ';
    
            $('body').append('<p>' + data + '</p>');
        },
        easing: 'linear'
    });
    
    $('#getTime').click(function () {
        $('#ball').stop();
        $('body').prepend('<p>currentTime is:' + currentTime + ' ms; REMAINING: ' + (time - currentTime) + 'ms</p>');
    });
    
    • You can see how I used the fx.prop inside the animation step to get the (left) property that is currently animated.
    • You can see how: knowing the animation time and the distance (opacity, whatever…) we can easily retrieve the ‘stopped/paused’ state by some simple math ((now*time)/distance) and thanks to the returned now value.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have the following html: This a test of <code>some code</code>. <div class='highlight'>
Suppose you have some <div> s: <div id=div_num1></div> <div id=div_num2></div> <div id=div_num3></div> You can
Suppose I have html like this: <div id=wrap> <div id=content> <span>some content</span> <div id=s1>
Suppose I have a div with some text in it <div id='page' style='width: 600px'>
Let's suppose I have some div with picture. Above this div there is another
Suppose I have this HTML: <div id=Wrapper> <div class=MyClass>some text</div> <div class=MyClass>some text</div> <div
Suppose I have some class which has a property actor_ of type Actor .
Suppose I have some pointer, which I want to reinterpret as static dimension array
Propose to consider the following problem. Suppose we have some composite object. Are there
Lets suppose that I have some pages some.web/articles/details/5 some.web/users/info/bob some.web/foo/bar/7 that can call 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.