Question subject: Typing Status Bar Text javascript code
Posted: Mon Oct 20, 2008 12:00 am
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2279 Location: Earth Has thanked: 39 time Have thanks: 61 time
Looking for a way to enhance your web site? This JavaScript code will enable you to display text within your status bar that is typed line by line. This JavaScript provides a great way to tell your visitors about a special offer or whatever you'd like.
However, use this script cautiously, as you certainly don't want to irritate your visitors.
Place the following code between your <BODY> tags and place your lines of text where indicated in red. You may edit the typing speed by changing the text indicated in bold.
Code:
<SCRIPT language="JavaScript"> <!-- Script courtesy of http://www.web-source.net - Your Guide to Professional Web Site Design and Development var current = 0 var x = 0 var speed = 100 var speed2 = 100 function initArray(n) { this.length = n; for (var i =1; i <= n; i++) { this[i] = ' ' } } typ = new initArray(4) typ[0]="Your First Line of Text Here" typ[1]="Your Second Line of Text Here" typ[2]="Your Third Line of Text Here" typ[3]="Your Fourth Line of Text Here" function typewrite() { var m = typ[current] window.status = m.substring(0, x++) + "" if (x == m.length + 1) { x = 0 current++ if (current > typ.length - 1) { current = 0 } setTimeout("typewrite()", speed2) } else { setTimeout("typewrite()", speed) } } typewrite() // --> </SCRIPT>
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )