Yeni42
<html>
<head>
<title>Text Changer</title>
<script language=javascript>
<!--
/*/¯/¯/¯/¯/¯/¯/¯/¯/¯/¯/¯/¯/¯ /
/ =-=-=-=-=-= Text Changer =-=-=-=-=-= /
/ Author: /
/ Nick Trevino /
/ Description: /
/ This code changes the text within the <div> tag below. You can show /
/ any number of lines, and it still will show them all! It also stops /
/ changing the text if the user has their mouse over the text. If you /
/ don't want mouse overs to stop it from changing, then set stopOK to /
/ 0 instead of 1. /
/ Usage Tips: You can use this and the HTML tag /
/ <img> to make it change different images on a set timer! Or you can /
/ also use it to change links using the stopping feature so users can /
/ click the links! See if there are other ways you can use it. /
/
_/_/_/_/_/_/_/_/_/_/_/_/_/*/
// Just put the different bits of text into the array separated by a comma.
// You can use HTML tags also. If you need to use quotes, use the single quote,
// ( ' ) or use the escape character ( " ), both without parenthesis.
textLines=new Array( "<b>Text Changer</b>",
"Created By...",
"<b>Nick Trevino</b>",
"Visit my JavaScript site at:",
"<a href='http://www.nicksscripts.be'>Nick's Scripts.be</a>",
"This script is on...",
"<a href='http://www.javascripts.com'>JavaScripts.com!</a>");
// The Text Line to start on (The first line is line 0).
numOn=0;
// Set the delay time inbetween each change (in seconds, decimal values can be used).
delay=1.3;
// Set this variable to 0 to stop mouse overs from stopping
// the text from changing.
stopOK=1;
change=1;
window.onload=start;
function start(){
setTimeout("Change()",1);
}
function Change(){
// Check to see if the user has their mouse over the text.
if(change==1){
// Make sure we are on a valid Line Number and if not, set it to
// the starting line.
if(numOn>=textLines.length||numOn<0){numOn=0}
// Set the text inside the <div> to the specified line number.
textChanger.innerHTML=textLines[numOn];
// Increase the line number by one to get the next string.
numOn++;
}
// Call this function again to write the string to the <div>.
setTimeout("Change()",delay*1000);
}
// -->
</script>
</head>
<body>
I was bored one day, so I made this. Maybe it will be useful to someone...
Here are the lines of text this example will change through:
<pre>
1: <b>Text Changer</b>
2: Created By...
3: <b>Nick Trevino</b>
4: This script is on...
5: <a href='http://www.javascripts.com'>JavaScripts.com!</a>
6: Put this <div> tag
7: Anywhere on a page!
</pre>
It can do more lines to if you need to. It can do as many as you need!
In this example, the stopping feature is set to: ON. Try moving your mouse over the text. <br>
It will stop changing.<br><br>
<div id="textChanger" onMouseOver="if(stopOK==1){change=0}" onMouseOut="change=1"></div>
</body>
</html>