js add animation to element

document.getElementById('test').style.animation = 'fading 2s infinite'

4
7
Grey Rules 85 points

                                    let rotate360 = [
  { transform: 'rotate(360deg)' }
];

4 (7 Votes)
0
5
4
Matej 115 points

                                    #test {
    background-color: blue;
    width: 100px;
    height: 100px;
    position: relative;
    -webkit-animation: fading 5s infinite;
    animation: fading 5s infinite;
}

/* Here is the animation (keyframes) */
@keyframes fading {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

5 (4 Votes)
0
4.33
6

                                    < script  src = ' /path/to/jquery.keyframes [.min ] .js ' > </ script >

4.33 (6 Votes)
0
3.7
11
Adam Naylor 105 points

                                    var animation = element.animate(keyframes, options); 

3.7 (10 Votes)
0
3.5
2
Brittany 120 points

                                    document.getElementById("tunnel").animate([
  // keyframes
  { transform: 'translateY(0px)' },
  { transform: 'translateY(-300px)' }
], {
  // timing options
  duration: 1000,
  iterations: Infinity
});

3.5 (2 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
how to make keyframes in javascript adding animation in js how can set animation with in javascript js keyframes object keyframes in js how to add ANIMATION in js how to add animation in html using javascript how to handle keyframes from javascript javascript element animation js keyframes animation of an element using javascript keyframes in jss javascript create element with animation html add animation from js javascript to to apply animation add animation to div with js how to add animation to js how to add animation through dom add animation to element javascript css element animation javascript added animation javascript how to add animation thur javascript how to apply js animation animation element using javascript how to add animation with javascript add animation from js how to set animation in js how to add animation inside js javascript apply animation to element how to insert an animation using javascript javascript code for inserting animation add animation to element with javascript js @keyframes how to add animation to element in javascript add a animation using javascrip[t use keyframes in javascript add animation on js set animation in javascript from to keyframes js using keyframes with js javascript add animation when keyframes with js apply animation js how to add animation javascript how to put animation attribute in js keyframe using javascript javascript @keyframe js create keyframes how to add animation to website using javascript add animation in js js add animation js keyframes with javascript how to add animation on js how to write keyframes in js java script keyframes set animation with javascript add animation through js add animation javascript how to add animation using javascript javascript animations js dom display animation add animation in javascript how to use keyframes in javascript add animation using javascript how to add animation in javascript javascript add animation to element set animation from javascript keyframes js add animation via js js html element animation how to use keyframes with javascript add animation using js how to add animation to element javascript dom animate jss keyframes javascript animate timing options keyframes javascript js add animation javascript animate method nice js element animations element.animate() js element animate js animation create keyframes in js get element by animation id animate javascript keyframes jss animate objects javascript js get keyframe animate js get start javascript animate() element.animate animate javascript function set an animation with js @keyframes in js js add animaton how to play animations in js js add animation to element .animate js javascript animate elements Key.js mdn javascript animations element.animate javascript target keyframe animations javascript animate in js js animate queryselector animate javascript add animation javascript .animate javascript animate javascript keyframes js .animate javascript create keyframe animation
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source