Advertisements

How To Add Scrolling Text to Status Bar

Posted by Lasantha Bandara on September 14th, 2009 File Under : gadget, java script, widget1 Comment

1.Login to your blogger dashboard and go to Layout --> Page Elements.

2.Click on 'Add a Gadget' on the sidebar.

3.Select 'HTML/Javascript' and add the one of code given below and click save.

<script language=javascript>
function statusbar(val)
{
var msg = "TYPE-YOUR-MESSAGE-HERE";
var res = " ";
var speed = 100;
var pos = val;

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

Now you are done.

File Under : gadget, java script, widget

One Response to “How To Add Scrolling Text to Status Bar”

  1. Casi K. says:

    Thanks! This is exactly what I was looking for!

Leave a Reply