GUI Components JavaScript DHTML




Type Writer

.link{font-family:verdana,arial,helvetica; font-size:8pt; color:#003399; font-weight:normal}
.link:hover{font-family:verdana,arial,helvetica; font-size:8pt; color:#0099FF; font-weight:normal}
.prem_hint{font-family:verdana,arial,helvetica; font-size:8pt; color:#000000; font-weight:normal}
.header{font-family:arial,verdana,helvetica; font-size:20pt; color:#FA5D00; font-weight:bold}



// Location of this script:
// http://www.qiksearch.com/javascripts/type_writer.htm
//*********************************************
//* Type Writer effect                        *
//* This script create a  type writer effect  *
//* (c) Premshree Pillai,                     *
//* http://www.qiksearch.com                  *
//* E-mail : premshree@hotmail.com            *
//* Use the script freely as long as this     *
//* message is intact                         *
//*********************************************
window.onerror = null;
 var bName = navigator.appName;
 var bVer = parseInt(navigator.appVersion);
 var NS4 = (bName == "Netscape" && bVer >= 4);
 var IE4 = (bName == "Microsoft Internet Explorer" 
 && bVer >= 4);
 var NS3 = (bName == "Netscape" && bVer < 4);
 var IE3 = (bName == "Microsoft Internet Explorer" 
 && bVer < 4);
 var time_length =100; //Scroll speed
 var begin_pos=55;
 var left_pos=110;
 var i=1;
 var text_type = "Type Writer effect by Premshree Pillai";
 var text_type_len= text_type.length;
 
function type()
{
for(var i=1; i<=text_type_len; i++)
{
document.write('');
document.write('' + text_type.charAt(i-1) + '
');
}
dotype();
}
function dotype()
{
 setTimeout("Show('"+text_type+i+"')",time_length);
}
if (NS4 || IE4) {
 if (navigator.appName == "Netscape") {
 layerStyleRef="layer.";
 layerRef="document.layers";
 styleSwitch="";
 }else{
 layerStyleRef="layer.style.";
 layerRef="this.document.all";
 styleSwitch=".style";
 }
}
//SHOW
function Show(layerName){
 if (NS4 || IE4) { 
 eval(layerRef+'["'+layerName+'"]'+
 styleSwitch+'.visibility="visible"');
 if(i {
 i++;
 dotype();
 }
 }
}
type();





Type Writer effect







This is a JavaScript that creates a type writer effect for a text like the one above.


You can change the text by changing the variable text_type.
The distance of the text from top can be changed by changing the variable begin_pos (Here it is 55). The distance of the text from the left can be changed by changing the variable left_pos (Here it is 110). You can also change the speed of typing by changing the variable time_length.




© Premshree Pillai