-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.html
35 lines (33 loc) · 849 Bytes
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
@keyframes moveRight {
from {
transform: translateX(0);
}
to {
transform: translateX(300px);
}
}
#hanbyeol {
animation: 1s moveRight forwards;
}
</style>
</head>
<body>
<img
src="https://item.kakaocdn.net/do/592728ea7408bcf69f797c0446b584a6c37d537a8f2c6f426591be6b8dc7b36a"
id="hanbyeol"
alt="집에 가는 한별이"
/>
<script>
const $hanbyeol = document.querySelector('#hanbyeol');
$hanbyeol.addEventListener('animationend', () => {
alert('한별이가 오른쪽으로 이동했어요!');
});
</script>
</body>
</html>