Detecting the end of a CSS transition

An example showing how to detect the end of a CSS transition using Tizen 2.3.
<style>
#transition {
    position: absolute;
    width: 100px;
    height: 100px;
    background-color: lightgreen;
    opacity: 1;
    -webkit-transition: all 1s ease;
}
    
#transition:active {
    opacity: 0;
}
</style>
<div id="transition"></div>
<script>
var element = document.getElementById('transition');

var onTransitionEnd = function() {
  alert('ended');
};

element.addEventListener('webkitTransitionEnd', onTransitionEnd);
</script>

Responses

0 Replies