Code: Alles auswählen
<script type="text/javascript">
// --------------------------------------------------
// --- (c) 2005 WebWorkerWorld.de -------------------
// --------------------------------------------------
var i=0;
var j=true;
window.document.write("<p id=\"foo\" style=\"letter-spacing:"+i+"px;text-align:center;font-weight:bold;\">Elastischer Text</p>");
function Animate()
{
window.document.getElementById("foo").style.letterSpacing=((j)?(++i):(--i))+"px";
if (i==0 || i==20)
{
j=!j;
}
window.setTimeout("Animate()", 40);
}
window.onload=Animate;
</script>