-
Notifications
You must be signed in to change notification settings - Fork 0
/
zoom.html
52 lines (44 loc) · 1.26 KB
/
zoom.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
45
46
47
48
49
50
51
52
<html>
<head>
<script>
var width = 500;
var diff = 2;
var x = 0;
function increase()
{
window.clearInterval(x);
x = setInterval(expand,20)
}
function decrease()
{
window.clearInterval(x);
x = setInterval(shirink,20)
}
function expand()
{
if(width<500)
{
width = width + diff;
document.getElementById("img").style.width=width;
}
else{
window.clearInterval(x);
}
}
function shirink()
{
if(width>100)
{
width = width - diff;
document.getElementById("img").style.width=width;
}
else{
window.clearInterval(x);
}
}
</script>
</head>
<body>
<img id="img" onmouseover="increase()" onmouseout="decrease()" src="990d671c0f7040bf1b34800ec941df6e.4.jpg" width = "500">
</body>
</html>