Script Categories













Messages >>> Text Highlighter.

Alternates the font color of each character in a line of text. Useful to catch the attention of your web site visitors. You may also customize the color and font of the text.

Add the below code to the <body> section of your page:

<script language="javascript" type="text/javascript">      
/* Visit http://www.yaldex.com/ for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
text = "JavaScript Rules"; // The text to scroll
color1 = "blue"; // original text color
color2 = "red"; // new character color
fontsize = "8"; // font size of text
speed = 200; // how fast to rotate to next character
// time is in milliseconds, (i.e. 1000 = 1 second)

i = 0;
document.write("<div id=a></div>");
function changeCharColor()  {
str = "<center><font size=" + fontsize + "><font color=" + color1 + ">";
for (var j = 0; j < text.length; j++) {
if( j == i) {
str += "<font color=" + color2 + ">" + text.charAt(i) + "</font>";
}
else {
str += text.charAt(j);
   }
}
str += "</font></font></center>";
document.getElementById('a').innerHTML = str;
(
i == text.length) ? i=0 : i++; // reset after going through all letters
}
setInterval("changeCharColor()", speed);
//  End -->
</script>

JavaScript Editor Get Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.



Code was highlighted by 1st JavaScript Editor (The Best JavaScript Editor!).




©