Displaying Status bar text using Java script

Displaying Status bar text using Java script

We can display status bar text in web page using the following way. We can place the following code between <BODY> tags. We can also edit the typing speed.
<SCRIPT language=”JavaScript”>
var current = 0
var x = 0
var speed = 150
var speed2 = 150
function initArray(n) {
this.length = n;
for (var k =1; k <= n; k++) {
this[k] = ‘ ‘
}
}
typ = new initArray(4)
typ[0]=”Hello user!”
typ[1]=”Welcome to our site.”
typ[2]=”Enjoy the features of this site!”
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>

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.