[TextHighLighter]

[Code]

[zwischen <BODY> und </BODY>]

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: K. Rama Moorthy -->
<!-- Web Site: http://www.suyambhu.bizhosting.com -->
<!-- Modifications: N8i (www.nightfire.ch) -->


<!-- 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)

var ns4up = (document.layers) ? 1 : 0; // browser sniffer
var ie4up = (document.all) ? 1 : 0;
var mozup = (!document.all && document.getElementById) ? 1 : 0;


i = 0;
if (ns4up) {
document.write("<layer id=a visibility=show></layer><br><br><br>");
}
if (ie4up || mozup) {
document.write("<div id=a></div>");
}

function changeCharColor() {
if (ns4up) {
document.a.document.write("<center><font size =" + fontsize + "><font color=" + color1 + ">");
for (var j = 0; j < text.length; j++) {
if(j == i) {
document.a.document.write("<font color=" + color2 + ">" + text.charAt(i) + "");
}
else {
document.a.document.write(text.charAt(j));
}
}
document.a.document.write('</center>');
document.a.document.close();
}
if (ie4up || mozup) {
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) + "";
}
else {
str += text.charAt(j);
}
}
str += "</center>";
a.innerHTML = str;
}

(i == text.length) ? i=0 : i++; // reset after going through all letters
}
setInterval("changeCharColor()", speed);
// End -->
</script>

[Autor]

K. Rama Moorthy
Modifications for DOM compatibility by N8i

[Download]

Kopieren Sie bitte den Code

Copyright © 1998- Nightfire Webworker Archiv Script No: 441