Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Simple Javascript Title Typer/Roller, Cool Title effect

SpaceshipSpaceship
NamecheapNamecheap
Namecheap AuctionsNamecheap Auctions
Watch

Kilk

Powered by LinuxEstablished Member
Impact
30
Hey guys...Here is a simple Javascript Title effect which types the title and then it scrolls. Rep++ is much apperciated :)

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.
 
3
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Rep left. :)
 
0
Close
briman1970 said:
Rep left. :)

Thanks, Glad you like it :)

Regards,
Carsen K.
 
0
Close
Does it work on all browsers?
 
0
Close
Can anyone show a preview of this in action?

Cheers - Frikkle.
 
0
Close
Cool effect. I'll use on my sites. Thanks alot. Rep added.
 
0
Close
0
Close
Ah cool really neat. I was wondering how sites did that lol.

Sweet.
 
0
Close
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

A browser tab with a favicon next to the page title
Search members
You can now search for members by name, company, location and more. Open the search at the top of any page and choose Members. You will...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back