You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.
Group: Admin
Posts: 121
Member No.: 1
Joined: 12-February 06
CODE
<div align="center"><h1>Changing Text Colours</h1></div><br> <div align="center"><p><script language="JavaScript1.2" type="text/javascript"> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin function initArray() { this.length = initArray.arguments.length; for (var i = 0; i < this.length; i++) { this[i] = initArray.arguments[i]; } } // Set the text to be displayed here. var ctext = "Wow! Look at all the pretty colours! ;-)"; // Set the speed of change here (in milliseconds) var speed = 1000; var x = 0; var color = new initArray( // Set the colours to be used here "red", "purple", "blue", "green", "black", "orange" ); if(navigator.appName == "Netscape") { document.write('<layer id="c"><center>'+ctext+'</center></layer><br>'); } if (navigator.appVersion.indexOf("MSIE") != -1){ document.write('<div id="c"><center>'+ctext+'</center></div>'); } function chcolor(){ if(navigator.appName == "Netscape") { document.c.document.write('<center><font color="'+color[x]); document.c.document.write('">'+ctext+'</font></center>'); document.c.document.close(); } else if (navigator.appVersion.indexOf("MSIE") != -1){ document.all.c.style.color = color[x]; } (x < color.length-1) ? x++ : x = 0; } setInterval("chcolor()",1000); // End --> </script></p></div><br>