Created
June 28, 2017 04:48
-
-
Save chintamanand/1ecfc49014c667e4e62ff8cb8a5f71c0 to your computer and use it in GitHub Desktop.
// source https://jsbin.com/jifituk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
</head> | |
<body> | |
<p id="demo"></p> | |
<script type="text/javascript"> | |
var i=50; | |
var j=5; | |
var a=window.setInterval(myFun1,100); | |
document.getElementById("demo").innerHTML="Anand"; | |
document.getElementById("demo").style.color="red"; | |
function myFun1() | |
{ | |
j+=1; | |
var par=j+"pt"; | |
document.getElementById("demo").style.fontSize=par; | |
if(j==50) | |
{ | |
window.clearInterval(a); | |
document.getElementById("demo").style.color="blue"; | |
i=50; | |
var b=window.setInterval(myFun2,100); | |
} | |
} | |
function myFun2() | |
{ | |
i-=1; | |
var par1=i+"pt"; | |
document.getElementById("demo").style.fontSize=par1; | |
if(i==5) | |
{ | |
window.clearInterval(b); | |
document.getElementById("demo").style.color="red"; | |
j=5; | |
var a=window.setInterval(myFun2,100); | |
} | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment