setTimeout fix for -webkit-transition
Here's a simple animation which utilizes webkitTransition:
Click to animate
The code behind this example is not complicated:
element.style.webkitTransitionProperty = 'left';
element.style.webkitTransitionDuration = '2s';
element.addEventListener('click', function () {
this.style.left = '100px';
this.addEventListener('webkitTransitionEnd', function () {
this.style.left = 0;
});
});
