Answers for "how to set animation in js"

6

js add animation to element

document.getElementById('test').style.animation = 'fading 2s infinite'
Posted by: Guest on January-18-2021
1

js add animation to element

var animation = element.animate(keyframes, options);
Posted by: Guest on January-18-2021
0

js add animation to element

let rotate360 = [
  { transform: 'rotate(360deg)' }
];
Posted by: Guest on January-18-2021
0

js add animation to element

#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; }
}
Posted by: Guest on January-18-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language