-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram_3.html
More file actions
35 lines (32 loc) · 782 Bytes
/
Copy pathProgram_3.html
File metadata and controls
35 lines (32 loc) · 782 Bytes
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>
<head>
<title>Animation of font size</title>
<script>
var font = 0, time;
function run() {
time = window.setInterval("i()",100); //100ms interval
}
function i() {
font = font+1;
show.innerHTML = "INCREASE at "+font; //TEXT-GROWING
show.style.fontSize = font;
if(font>49) {
window.clearTimeout(time);
window.setInterval("d()", 100);
}
}
function d() {
font = font-1;
show.innerHTML = "DECREASE at "+font; //TEXT-SHRINKING
show.style.fontSize = font;
if(font==5) {
window.clearTimeout(time);
window.setInterval("i()", 100);
}
}
</script>
</head>
<body onload = "run()">
<p id="show"></p>
</body>
</html>