Document Title Grows with Time

[Total: 0    Average: 0/5]

This will grow the document title to be the new mesage

Head Code:

<script type="text/JavaScript">
/*
 * Code updated on Sep-2007
 * - IE6 compatibility issue with spaces fixed
 */
var MESSAGE="This is the new title";
var TITLE="";
var i=0;

function compute()
{
  TITLE=MESSAGE.substr(0,i++);
  if(i>MESSAGE.length)
    clearInterval(timer);
}
var timer=null;
function ex_init()
{
  timer=setInterval("set_title()",99);
}
function set_title()
{
  compute();
  document.title=TITLE;
}
</script>

Init Code:

ex_init();

Body Code:

watch the document title build dynamically.

Times Viewed: 4

Leave a Reply

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