-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimationZoom.html
More file actions
71 lines (57 loc) · 1.48 KB
/
Copy pathAnimationZoom.html
File metadata and controls
71 lines (57 loc) · 1.48 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<html>
<head>
<title>Animations Zoomming </title>
<h1>Zoom Animations</h1>
<script type="text/javascript">
var width = 100
var difference =2
intervalId = 0
function incerase()
{
clearInterval(intervalId)
intervalId = setInterval(expand,10)
}
function expand()
{
if(width<200)
{
width=width+difference
document.getElementById("pc").style.width = width
console.log(width)
}
else
{
clearInterval(intervalId)
}
}
function decrease()
{
clearInterval(intervalId)
intervalId = setInterval(shrink,10)
}
function shrink()
{
if(width>100)
{
width=width-difference
document.getElementById("pc").style.width = width
console.log(width)
}
else
{
clearInterval(intervalId)
}
}
</script>
</head>
<body>
<br>
<br>
<img src="pc.png"
id="pc"
width="100"
onmouseover="incerase()"
onmouseout="decrease()"
>
</body>
</html>