Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

define keyframes with javascript

document.getElementById("tunnel").animate([
  // keyframes
  { transform: 'translateY(0px)' },
  { transform: 'translateY(-300px)' }
], {
  // timing options
  duration: 1000,
  iterations: Infinity
});
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #define #keyframes #javascript
ADD COMMENT
Topic
Name
7+1 =