Stretch Strings

[Total: 0    Average: 0/5]

Modify Letter Spacing in CSS.

Head Code:

<script language="JavaScript" type="text/javascript">
<!--
var m=50;
var w=m;x=2,y=0,z=0;
var time=20;
var a="ANOTHER";
var b="DIMENSION";
function startMe()
{
  if(x<=m)
  {
    var e=document.getElementById('sid0').style;
    /*increase letter-spacing (2-50)*/
    e.letterSpacing=x;
    x+=1;
  }
  else if(y==0)
  {
    /*Change inner text && set x to 2*/
    x=2;
    var e1=document.getElementById('sid0');
    with(e1.style)
    {
      fontWeight='bold';
      fontSize='20';
      letterSpacing=x;
    }
    e1.innerHTML=a;
    y=1;
  }
  else if(z==0)
  {
    /*Change inner text && set x to 2*/
    x=2;
    var e1=document.getElementById('sid0');
    with(e1.style)
    {
      fontWeight='bold';
      fontSize='20';
      letterSpacing=x;
    }
    e1.innerHTML=b;
    z=1;
  }
  else 
  {
    /*Decrease letter-spacing*/
    e2=document.getElementById('sid0');
    if(w>=2)
    {
      e2.style.letterSpacing=w;
      w-=1;
    }
    time=40;
  }
  setTimeout('startMe();',time);
}
//-->
</script>
<style type="text/css">
<!--
span,div{
letter-spacing:2;
font-weight:bold;
font-size:20;
color:red;
position:relative;
top:100;
}
-->
</style>

Body Code:

<center>
<span id='sid0'>
ENTER
</span>
<BR>
<a href='javascript:startMe()'>Click to Start</a>
</center>

Times Viewed: 1

Leave a Reply

Your email address will not be published. Required fields are marked *