1document.getElementById("tunnel").animate([
2 // keyframes
3 { transform: 'translateY(0px)' },
4 { transform: 'translateY(-300px)' }
5], {
6 // timing options
7 duration: 1000,
8 iterations: Infinity
9});
10
1#test {
2 background-color: blue;
3 width: 100px;
4 height: 100px;
5 position: relative;
6 -webkit-animation: fading 5s infinite;
7 animation: fading 5s infinite;
8}
9
10/* Here is the animation (keyframes) */
11@keyframes fading {
12 0% { opacity: 1; }
13 100% { opacity: 0; }
14}