Answers for "set animation from javascript"

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

document.getElementById("tunnel").animate([
  // keyframes
  { transform: 'translateY(0px)' },
  { transform: 'translateY(-300px)' }
], {
  // timing options
  duration: 1000,
  iterations: Infinity
});
Posted by: Guest on January-10-2021
1

js add animation to element

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

start animation with javascript

element.addEventListener("click", function(e){
  element.classList.remove("anim");
  setTimeout(() => element.classList.add("anim"), 0);
}, false);
Posted by: Guest on January-29-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language