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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:49:14+00:00 2026-05-31T00:49:14+00:00

I’m going to have cases where I need to pause all the animations on

  • 0

I’m going to have cases where I need to pause all the animations on the page in order to do some user interaction, and then resume all the animations as soon as the user has responded.

For example, I might have an animation that’s fading in over a 1s period, and 400ms in I need to pause it. It should stop at 40% opacity, and stay there until I resume, at which point it should pick up where it left off and spend another 600ms completing its fade-in from 40% to 100%.

There might be multiple animations on the page simultaneously, and I want to pause them all. Additionally, some animations might have further animations queued to continue after they complete, and that all needs to work: when I resume, the current animation needs to finish, and then the next one in the queue needs to start, just as if nothing happened.

jQuery doesn’t seem to have any built-in support for pausing animations; the closest I can find is .stop(), which will stop at the current spot in the animation, but can’t resume later; and it either moves on to the next animation in the queue immediately, or clears the animation queue entirely.

How can I pause the animations in a way that will let me resume them later?

  • 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-31T00:49:15+00:00Added an answer on May 31, 2026 at 12:49 am

    Pause / Resume Option

    The pause plugin will work well for this situation.

    HTML

    <div class=demo>
        <div id="box1" class="animationToPause"></div>
        <div id="box2" class="animationToPause"></div>
        <div id="box3" class="animationToPause"></div>
    </div>
    <input id="btnPause" type="button" value="Pause Animations" />
    

    CSS

    div.demo {
        border: 1px solid #555;
        margin: 1em auto;
        width: 550px;
    }
    #box1, #box2, #box3 {
        width: 100px;
        height: 100px;
        position: relative;
    }
    #box1 {
        background: #0C0;
    }
    #box2 {
        background: #090;
    }
    #box3 {
        background: #060;
    }​
    

    ​JavaScript

    $(function() {
        //Begin animation on boxes
        $("div[id^='box']").each(function() {
            phase1($(this));
        });
    
        //Setup animation pause/resume on hover
        $("div[id^='box']").hover(function() {
            $(this).pause();
        }, function() {
            $(this).resume();
        });
    });
    
    //Toggle animation pause/resume on button click
    $("#btnPause").toggle(
        function() {
            $(".animationToPause").pause();
        }, function() {
            $(".animationToPause").resume()
    });
    
    //Animation 1
    function phase1($this) {
        $this.animate({
            left: 450
        }, 2000, 'swing', function() {
            phase2($this)
        });
    }
    
    //Animation 2
    function phase2($this) {
        $this.animate({
            left: 0
        }, 2000, 'swing', function() {
            phase1($this)
        });
    }​
    

    Here’s a working fiddle to demonstrate.

    Brute Force Option

    Certainly not what you’re looking for, but related.

    Setting jQuery.fx.off = true; will stop all animations immediately.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
I need to clean up various Word 'smart' characters in user input, including but
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't

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.