This javascript function will help you to show a scrolling message in the title. Title bar is the topmost portion of the browser.
Simple html script that will give a special title effect.
Features
a) Title Bar script function to show scrolling (moving) messages in title.
b) Should work well in the Firefox browser.
d) Just copy the code in to your page and use it.
Preview
Title of this page
Code
<!-- Script by hscripts.com -->
<!-- copyright of HIOX INDIA -->
<!-- more scripts @ http://www.hscripts.com -->
<script type="text/javascript">
var rev = "fwd";
function titlebar(val)
{
var msg = "Your message here *** hscripts.com";
var res = " ";
var speed = 100;
var pos = val;
msg = " |--- "+msg+" ---|";
var le = msg.length;
if(rev == "fwd"){
if(pos < le){
pos = pos+1;
scroll = msg.substr(0,pos);
document.title = scroll;
timer = window.setTimeout("titlebar("+pos+")",speed);
}
else{
rev = "bwd";
timer = window.setTimeout("titlebar("+pos+")",speed);
}
}
else{
if(pos > 0){
pos = pos-1;
var ale = le-pos;
scrol = msg.substr(ale,le);
document.title = scrol;
timer = window.setTimeout("titlebar("+pos+")",speed);
}
else{
rev = "fwd";
timer = window.setTimeout("titlebar("+pos+")",speed);
}
}
}
titlebar(0);
</script>
<!-- Script by hscripts.com -->
For customization of this script or any script development, contact us at support@hscripts.com
Usage
a) Copy the code in to your page.
b) Change the message to what ever you want scrolling
change the line var msg = "Your message here --- hscripts.com";
example: var msg = "....... mysitename.com ......";
c) The speed can be altered by changing the variable speed.
License
- The javascript (misspelled as java script) is given under GPL License
- i.e. Free use for those who use the codes as it is.
- Free, if your modification does not remove our copyright information and links.
- Click Here for detailed license information.
- You can purchase the script if your requirements does not meet our GPL License terms.