الكود:

<script type="text/javascript">
/* Cursor Trailor Text- By Peter Gehrig (http://[url=http://www.24fun.com/%29]www.24fun.com/)[/url] */
var x = 0, y = 0;
var step = 20;
var flag = 0;

var message = "ضع هنا الكلمة";
message = message.split("");

var xpos = new Array();
for (i=0; i<message.length; i++)
{
  xpos[i]=-50;
}

var ypos = new Array();
for (i=0; i<message.length; i++)
{
  ypos[i]=-50;
}

function handlerMM(e)
{
  if (!e)
      var e = window.event||window.Event;

  if ('undefined' != typeof e.pageX)
  {
      x = e.pageX;
      y = e.pageY;
  }
  else
  {
      x = e.clientX + document.body.scrollLeft;
      y = e.clientY + document.body.scrollTop;
  }
  flag=1;
}

function makesnake()
{
  for (i=message.length-1; i>=1; i--)
  {
      xpos[i] = xpos[i-1] + step;
      ypos[i] = ypos[i-1];
  }
  xpos[0] = x + step;
  ypos[0] = y;
 
  for (i=0; i<message.length; i++)
  {
      var id = 'span'+i;
      var thisspan = document.getElementById(id);
      thisspan.style.left = xpos[i] + "px";
      thisspan.style.top = ypos[i] + "px";
  }
  var timer=setTimeout("makesnake()",30);
}
</script>

<script type="text/javascript">
for (i=0;i<=message.length-1;i++)
{
 
document.write("<span id='span"+i+"'
style='position:absolute;left:0px;top:-50px;font-size:12px;font-family:Al-Kharashi
20;font-weight:bold;color:#ضع هنا رمز اللون المطلوب للكلام;'>");
  document.write(message[i]);
  document.write("</span>");
}

if (document.layers)
{
  document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = handlerMM;
makesnake();

</script>