- Impact
- 30
Hey guys...Here is a simple Javascript Title effect which types the title and then it scrolls. Rep++ is much apperciated
Replace the "This is your title....Yep yep.....This is your title" with the title of your site for a cool little effect. Insert this code between your <head></head> tags.
Regards,
Carsen K.
Code:
<script language=javascript>
var rev = "fwd";
function titlebar(val)
{
var msg = "This is your title....Yep yep.....This is your title";
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>
Replace the "This is your title....Yep yep.....This is your title" with the title of your site for a cool little effect. Insert this code between your <head></head> tags.
Regards,
Carsen K.















