User:ProfMono

place

var CharacterPos = 0; var MsgBuffer = ""; var TypeDelay = 100; var NxtMsgDelay = 1500; var MsgIndex = 0; var delay; var MsgArray = [">Welcome...",">My name is 432.",">It is nice to meet you, reader.",">Please scroll down to proceed. Thank you."];

function StartTyping { var id = document.getElementById("typing-text"); if (CharacterPos != MsgArray[MsgIndex].length) { MsgBuffer = MsgBuffer + MsgArray[MsgIndex].charAt(CharacterPos); id.value = MsgBuffer+"_"; delay = TypeDelay; id.scrollTop = id.scrollHeight; } else { delay = NxtMsgDelay; MsgBuffer  = ""; CharacterPos = -1; if (MsgIndex!=MsgArray.length-1){ MsgIndex++; }else { MsgIndex = 0; }      }       CharacterPos++; setTimeout(StartTyping,delay); } StartTyping; })(