<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Switching Text</title>
<style>
.let{
color:white;
font-family:Verdana;
font-weight:bold;
width:500;
filter:Shadow (Color="#6699CC", Direction="135")wave(Add="0", Phase="4", Freq="9", LightStrength="20", Strength="1") ; 
}

</style>

<script language="JavaScript">

var regel = 0;			//row to start with
var size = 20;			//size of font
var delay = 1200; 		//Delay between messages in msecs
var speed = 20;			//Hmmmmmm
var step = 10;			//Size of each step


var sent = new Array()
{
sent[0] = "Your text here!";
sent[1] = "Unlimited";
sent[2] = "Text";
sent[3] = "But IE4+ ";
sent[4] = "Netscape Forget it..";
sent[5] = "Your choice";
}

sent[sent.length] = sent[0];var veran = 0;var num = 0;var x = 0;//Don't change
function moto(){output = "";for(letter = 0;letter<sent[regel+1].length;letter++){
if(veran == letter){if(x==0){num=num+step;}else{num=num-step;}gr = size-num;
if(gr < 1){x=1;gr=1;}if(gr>size)gr=size;
output += "<font style='font-size:"+gr +"pt'>"+sent[regel+x].substring(letter, letter+1)+"</font>";
if(num < 0 && x==1){veran++;x=0;}}else{if(veran > letter){
output += "<font style='font-size:"+size +"pt'>"+sent[regel+1].substring(letter, letter+1)+"</font>";
}else{output += "<font style='font-size:"+size +"pt'>"+sent[regel].substring(letter, letter+1)+"</font>";}}}
return output;}function startmot(){if(regel==sent.length-1)regel=0;balk.innerHTML = moto();
if(veran==sent[regel+1].length){regel++;veran = 0;setTimeout("startmot()", delay);}else{
setTimeout("startmot()", speed);}}</script>
</head>

<body onload="startmot()">
<table style='cursor:hand' onclick=location="mailto:no-reply@test.com" align="center" id="tafel" bgcolor="lightblue" width=500 height="60">
<tr>
<td bgcolor="666666">
<div class='let' ID="balk" align="center"></div>
</td></tr></table>
</body>
</html>
Published in: JavaScript
Download

Related snippets