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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:33:41+00:00 2026-06-04T19:33:41+00:00

I wanna handle the css3 transformations using keyframes with javascript. This is a Question

  • 0

I wanna handle the css3 transformations using keyframes with javascript.
This is a Question I’ve never got an answer that is favorable anywhere.
If the example is

@-webkit-keyframes move{
    from{
        -webkit-transform:translate(0px,0px);
    }
    to{
        -webkit-transform:translate(0px,-100px);
    }
}

How can I give those values of translate dynamically using javascript.

  • 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-04T19:33:42+00:00Added an answer on June 4, 2026 at 7:33 pm

    The scenario is slightly complicated with you not being able to explicitly assign an undeclared animation even in css; i.e. in your sample you’re declaring a “move” animation.

    That being said, you’re able to generate stylesheets at runtime – the following CSS rules would be fairly trivial to generate:

    @-webkit-keyframes moveA{/*keyframes*/}
    #smokeA {-webkit-animation: moveA 5s infinite; }
    @-webkit-keyframes moveB{/*keyframes*/}
    #smokeB {-webkit-animation: moveB 5s infinite; }
    ...
    

    And could then be appended to to document’s head like so:

    $('head').append('<style type="text/css">/*css rules here*/</style>');
    

    Proof of concept (with rather horrible styles being added 5 seconds into the page load)

    NB: I’ve noticed that with GPU acceleration enabled, the FPS counter gets triggered on my Chrome. That leads me to speculate this is may be in fact a better performing approach, compared to jQuery animation.

    Update:

    Seing Katti’s comment re intending to change the style values every few seconds – I’d rather you not. You could very well get away with generating only a fixed subset of animations; imo the Cicada Principle would be highly applicable in this scenario – just think of movement rather than graphical patterns when reading the article. A truly random animation would not look realistic unless applied to an extremely large amount of small particles (which would likely kill the browser) – meaning that animating pre-rendered sprites would be the way to go.

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

Sidebar

Related Questions

I wanna implement a javascript like method in java , is this possible ?
I am using UIWebView to display pdf. I wanna handle touch events on webview.
I've got this layout that i want to cut into html/css, but i'm struggling
I am using argparse to handle cmd args, I wanna if there is no
i wanna add a service behavior(or anything u'll suggest) that will automatically insert the
I wanna verify a digitally signed xml against its schema definition while this schema
I wanna know that how we can identify whether a page is redirecting to
i wanna using curl in php script and run it in command line mode.
I wanna constrain to input special signs like £ ¬ ¦ in javascript,but they
I wanna have a drop down that lets me select Week Commencing Monday 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.