-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathl3q1.html
50 lines (48 loc) · 1.69 KB
/
l3q1.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
<!DOCTYPE html>
<!--
To make a website where WORD-GROWING
grows and then after a time period, it
changes to WORD-SHRINKING and shrinks
-->
<html>
<head>
<title>
ITT LAB 3 Q1
</title>
<meta charset="UTF-8">
<link href="l3q1.css" l="stylesheet" type="text/css">
</head>
<body>
<div class="header">
<center><h1>JAVASCRIPT - I</h1></center>
<center><h3> <i>Grow N Shrink</i> </h3></center>
<hr>
<div id="card">
<center><p id="textchange"></p></center>
</div>
<script>
var V1 = setInterval(inTimer, 100);
var FS = 10;
var anim = document.getElementById("textchange");
function inTimer() {
anim.innerHTML = 'TEXT-GROWING';
anim.setAttribute('style', "font-size: " + FS + "px; color: red");
FS += 5;
if(FS >= 50 ){
clearInterval(V1);
V2 = setInterval(deTimer, 100);
}
}
function deTimer() {
FS -= 5;
anim.innerHTML = 'TEXT-SHRINKING';
anim.setAttribute('style', "font-size: " + FS + "px; color: blue");
if(FS === 5 ){
clearInterval(V2);
V1 = setInterval(inTimer, 100);
}
}
</script>
</div>
</body>
</html>