-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathp3.html
52 lines (41 loc) · 980 Bytes
/
p3.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
<!DOCTYPE html>
<html>
<head><title> Text Grow and Shrink </title></head>
<body>
<p id="myp1" style="text-align:center" > </p>
<script>
var size = 10 ;
var mywait = setInterval(growtext , 100 ) ;
function growtext()
{
if( size < 51 )
{
size += 1 ;
document.getElementById("myp1").innerHTML = "Text Growing" ;
document.getElementById("myp1").style.fontSize = (size+'pt') ;
document.getElementById("myp1").style.color = "red" ;
}
else
{
clearInterval(mywait) ;
mywait = setInterval(shrinktext , 100 ) ;
}
}
function shrinktext()
{
if(size > 5 )
{
size -= 1 ;
document.getElementById("myp1").innerHTML = "Text Shrinking " ;
document.getElementById("myp1").style.fontSize = (size+'pt');
document.getElementById("myp1").style.color = "blue" ;
}
else
{
clearInterval(mywait) ;
mywait = setInterval(growtext , 100 ) ;
}
}
</script>
</body>
</html>