Animating Text Styles : Text HTML : HTML JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » HTML » Text HTML »

 

Animating Text Styles




<html>
<head>
<title>Styling Text</title>
<script language="JavaScript">
var color = true
var heading = null
function styleText(milliseconds) {
 window.setInterval("changeColors()", milliseconds)
}
function changeColors() {
 var heading;
 if(document.getElementById != null)
   heading = document.getElementById("styleme")
 else if(navigator.appName == "Microsoft Internet Explorer")
   heading = document.all.item("styleme")
 
 if(color && heading != null) {
   heading.style.backgroundColor = "rgb(255,0,0)"
   heading.style.color = "rgb(0,200255)"
 }else if(heading != null) {
   heading.style.backgroundColor = "rgb(255,255,255)"
   heading.style.color = "rgb(0,200,0)"
 }
 color = ! color;
}
</script>
</head>
<body onload="styleText(1000)" bgcolor="white">
<h1 align="center" id="styleme" style="background-color: rgb(255,255,255)">
I am changing!</h1>
</body>
</html>

           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo HTML
» Text HTML