Created
July 26, 2016 08:27
-
-
Save Leolik/ab3370b6f0f045877db2a154e2f7a596 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var box = document.querySelector('.box'); | |
var message = document.querySelector('.message'); | |
var player = box.animate([ | |
{ | |
transform: 'translateX(0)', | |
opacity: 0 | |
}, | |
{ | |
transform: 'translateX(100px)', | |
opacity: 1 | |
} | |
], { | |
duration: 2000, | |
iterations: 3, | |
delay: 100, | |
easing: 'ease-in-out', | |
direction: 'alternate' | |
}); | |
player.onfinish = function() { | |
message.innerHTML = 'done'; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment