Scroll text in Status Bar


In this article I explain about how to show scrolling text in the status bar of the internet Explorer.

This will show scrolling text in the status bar of the internet Explorer.


<html>
<head>
<script language="JavaScript">
var msg="Computer Applied Technology "
var pos=0
var sp=" "
var len
function src()
{
len=msg.length
setInterval("f1()",250)
}
function f1()
{
window.status=msg.substring(pos,len)+sp+msg.substring(0,pos)
//+sp+msg.substring(len+30,pos)
pos=pos+1
if(pos==len)
pos=0
}
</script>
</head>
<body onload="src()">
</body>
</html>



Comments

Author: Phagu Mahato19 Jan 2014 Member Level: Gold   Points : 8

You can use this code snippet for Scroll text in Status Bar


function statusbar(val)
{
var massage = "Scrolling text";
var res = " ";
var speed = 100;
var Position = val;

if (position > 0) {
for (var Position=0 ; Position< position; Position++) {
res += " ";
}
res+=massage;
position--;
window.status = res;
timer = window.setTimeout("statusbar("+position+")",speed);
}
else{
if( -position < massage.length) {
res += massage.substring(-position,massage.length);
position--;
window.status=res;
timer = window.setTimeout("statusbar("+position+")",speed);
}
else
{
window.status= " ";
timer = window.setTimeout("statusbar(100)",speed);
}
}
}
statusbar(100);


//Another example

Be sure to edit the text that will scroll!


function scrollit(seed) {
var msg1 = "Code Snippet";
var msg2 = " To Scroll text ";
var msg3 = " In JavaScripts!";
var msg4 = "";
var msg=msg1+msg2+msg3+msg4;
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);
}
}
}



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: