-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdescriptiondis.html
44 lines (37 loc) · 1 KB
/
descriptiondis.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
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.hidden {
display: none;
}
</style>
</head>
<body>
<button>Click</button>
<div class="hidden"><img id="divdiv" src="" ></div>
<script>
secondanim = 1;
document.querySelector('button').addEventListener('contextmenu', e => {
e.preventDefault()
return false
});
document.querySelector('button').addEventListener('mousedown', e => {
if (e.buttons === 2) {
e.preventDefault()
e.stopPropagation()
} else {
return
}
document.getElementById("unitdescription").src='allanimations/description' + secondanim + '.PNG';
document.querySelector('div').classList.remove('hidden')
})
document.addEventListener('mouseup', e => {
const div = document.querySelector('div')
!div.classList.contains('hidden') && div.classList.add('hidden')
})
</script>
</body>
</html>