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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:12:43+00:00 2026-06-11T14:12:43+00:00

How can you detect which CSS animation just finished in JavaScript? The ultimate need

  • 0

How can you detect which CSS animation just finished in JavaScript?

The ultimate need is to re-trigger a CSS animation. Due to our HTML hierarchy, we prefer not checking the element’s class but instead taking action only when a particular animation ends. If you have a method that allows re-triggering an animation without removing/adding a class, please let us know.

Otherwise… our code:

    page.find( '.button.letter' ).on( 'webkitAnimationEnd', function() {
        $( this ).removeClass( 'tap_animation' );

        console.log( 'Hi: ' + this.style.webkitAnimationName );

        if ( !write_mode() ) {
            do_write( this );
        }
    });

this.style.webkitAnimationName always returns the empty string.

Are we doing something wrong?

We need the code for WebKit browsers, specifically Mobile Safari.

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-11T14:12:45+00:00Added an answer on June 11, 2026 at 2:12 pm

    From jQuery you can access the originalEvent object, and, from there, the animationName property:

    $('body').on('webkitAnimationEnd', function(e){
        var animName = e.originalEvent.animationName;
        console.log(animName);
    });​
    

    (Webkit-only) JS Fiddle demo.

    From there, simply use an if to check what the animation name is/was (past-tense, I suppose, given that it ended).

    The above updated, to give possibly a better illustration:

    $('div').on('webkitAnimationEnd', function(e){
        var animName = e.originalEvent.animationName;
        if (animName == 'bgAnim') {
            alert('the ' + animName + ' animation has finished');
        }
    });​
    

    (Webkit-only) JS Fiddle demo.

    This demo uses the following HTML:

    <div><span>text</span></div>​
    

    And CSS:

    @-webkit-keyframes bgAnim {
        0%, 100% {
            color: #000;
            background-color: #f00;
        }
        50% {
            color: #fff;
            background-color: #0f0;
        }
    }
    
    @-webkit-keyframes fontSize {
        0%, 100% {
            font-size: 100%;
        }
        50% {
            font-size: 300%;
        }
    }
    
    div {
        font-weight: bold;
        -webkit-animation: bgAnim;
        -webkit-animation-duration: 2s;
        -webkit-animation-iteration-count: 2;
    }
    
    span {
        font-size: 100%;
        font-weight: bold;
        -webkit-animation: fontSize;
        -webkit-animation-duration: 4s;
        -webkit-animation-iteration-count: 1;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was just wonderhing how some libraries can detect in which thread they run
I need to write and algorithm that can detect which state an application (used
I wonder if anyone can work this HTML, CSS, Javascript puzzle out? I'm using
A there any g++ options which can detect improper initialization of std::string with NULL
Is there a way in which I can detect the URL that is calling
In MDI application which event can the child Form class use to detect when
How can i detect which browser type the client is using. I have a
Possible Duplicate: How can we programmatically detect which iOS version is device running on?
How can I detect which CPU is being used at runtime ? The c++
How can I detect which version of Delphi was used to compile a pre-existing

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.