Text Grows Then Dissapears.

[Total: 0    Average: 0/5]

This shows how to have text enlarge itself and then dissapear.

Head Code:

<script>
function startThis() {
 position_at_top();
 expand();
}
</script>

Body Code:

Normally you would have this in your code, since this is in the database, you
will need to <a href="javascript:startThis()">click here to start this example</a><BR>
&lt;body onLoad="startThis()"><BR>
<div style="position:absolute" id="test"></div>
<script>
var themessage="Awesome Script!";
var fontsize=14;
var fontface="Arial";
var appearfor=3000; // 3 seconds

function position_at_top(){
  if (document.layers)
    document.test.top=pageYOffset;
  if (document.all){
    test.innerHTML='<div align=center><font face="'+fontface+'">'+themessage+'</font></div>'
    setTimeout("test.style.top=document.body.scrollTop",100)
  }
}

function expand(){
  if (document.layers){
    document.test.document.write('<div align=center style="font-size:'+fontsize+'px"><font face="Arial" color="red" >'+themessage+'</font></div>')
    document.test.document.close()
  }
  if (document.all)
    test.style.fontSize=fontsize+'px';
  fontsize+=5;
  if (fontsize>90){
    if (document.layers)
      setTimeout("document.test.visibility='hide'",appearfor);
    if (document.all)
      setTimeout("test.style.visibility='hidden'",appearfor);
    return;
  }
  else
    setTimeout("expand()",50);
}
</script>

Times Viewed: 2

Leave a Reply

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