en.javascript.info/5-animation/2-css-transitions/1-animate-logo-css/solution.view/index.html
2015-03-09 19:02:13 +03:00

47 lines
No EOL
680 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://js.cx/clipart/flyjet.jpg">
<script>
flyjet.onclick = function() {
var ended = false;
flyjet.addEventListener('transitionend', function() {
if (!ended) {
ended = true;
alert('Готово!');
}
});
flyjet.classList.add('growing');
}
</script>
</body>
</html>