Setting Scroller text in status bar

Setting Scroller text in status bar

We can give more attention to our sites by giving status bar text in our web sites. The following script will scroll any text along the status bar.

We can use the following script into the <body> tags of our page.

<BODY onLoad=”scrollit(100)”>
<SCRIPT>
<!–
function scrollit(seed) {
var m1 = “Hello user!”;
var m2 = ” welcome to our Sitename!”;
var m3 = ” Enjoyed site features!”;
var m4 = “”;
var msg=m1+m2+m3+m4;
var out = ” “;
var c = 1;
if (seed > 100) {
seed–;
cmd=”scrollit(”+seed+”)”;
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 100 && seed > 0) {
for (c=0 ; c < seed ; c++) {
out+=” “;
}
out+=msg;
seed–;
window.status=out;
cmd=”scrollit(”+seed+”)”;
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 0) {
if (-seed < msg.length) {
out+=msg.substring(-seed,msg.length);
seed–;
window.status=out;
cmd=”scrollit(”+seed+”)”;
timerTwo=window.setTimeout(cmd,100);
}
else {
window.status=” “;
timerTwo=window.setTimeout(”scrollit(100)”,75);
}
}
}
//–>
</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.