Flag This Hub

Free Javascript Effects:Show moving message in Title bar of your website.

By


Your message would be scrolling on title bar of the webpage.
Your message would be scrolling on title bar of the webpage.

You might be familiar with many sites displaying a scrolling/moving message or sometimes simply the website name on the browser title-bar.Even websites like Facebook,Omegle do a variant of this to alert you about a new message or whenever an event occurs.While we won't be showing how to do that in this tutorial,I will try that out soon.For now,Lets simply get a message running on your Titlebar :


Here is a quickie way to do this!

<html>
<head>
<title id="titleElement"> </title>

</head>
<body>
<script>
var msg="Your Text Here";
var pos=0;
var titleElement = document.getElementById("titleElement");


function runningTitle()     //displays a scrolling title
{


titleElement.innerHTML = msg.substring(pos,msg.length);
pos++;
if(pos==msg.length)
pos=0;

setTimeout("runningTitle()",500);


}
runningTitle();
</script>
</body>
</html>
<!--This code made by Pradeep saini.
Website:puru13.hubpages.com!-->

Sadly Hubpages doesn't allow me to show the script in effect here.Although I use to direct my visitors to my blogger page to show the effect,but its not possible in this case.So please bear with us this time.ThankYou!

Copy the above code,put it in an empty notepad file and 'save as' it with filename: xyz.htm to see the effect.



If You Liked This,We've got more!

Javascript Your Website with us and increase its popularity

Comments

shanaya 9 months ago

Hello Puru! Once again an OUTSTANDING & INFORMATIVE HUB. You are a kind of TECHIE BUG it seems. LOL

I always like to comment first on my EVERY Friends HUB.

VOTED UP SO HIGH, AWESOME, INTERESTING, USEFUL.

More comments on your way INSHA-ALLAH:)

With Respect

From SHANAYA:)

puru13 9 months ago

Thanks Shanaya for your constant support and belief in me.And yes why are you making me wait so much for your second hub? Hop it soon!

Submit a Comment
Members and Guests

Sign in or sign up and post using a hubpages account.



    Like this Hub?
    Please wait working