en.javascript.info/7-animation/2-css-animations/1-animate-logo-css/solution.view/index.html
2019-04-02 14:01:44 +03:00

47 lines
672 B
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
img {
cursor: pointer;
}
</style>
<style>
#flyjet {
width: 40px;
height: 24px;
transition: all 3s;
}
#flyjet.growing {
width: 400px;
height: 240px;
}
</style>
</head>
<body>
<img id="flyjet" src="https://en.js.cx/clipart/flyjet.jpg">
<script>
flyjet.onclick = function() {
let ended = false;
flyjet.addEventListener('transitionend', function() {
if (!ended) {
ended = true;
alert('Done!');
}
});
flyjet.classList.add('growing');
}
</script>
</body>
</html>