JavaScript Bouncing Marquee text scroll at Status Bar of web browser

E-mail Print PDF

JavaScript Bouncing Marquee text scroll at Status Bar of web browser

With the help of JavaScript we can add our favorite message with Bouncing Marquee text scroll effect. First of all JavaScript Bouncing Marquee text scroll at Status Bar of web browser.

In this section we see how to add bouncing message at status bar of browser. So we define variables data contain message to be display, limit define bounce limit, message1, direction, speed. Now define function bounce() contain if-else condition helps to bounce message left or right. To shift message left we add two spaces to message1 and assign to message2 message2 = message1.substring( 2,message1.length )+"  "; and display it at status bar by window.status=message2;. We refresh message by setTimeout( "bounce();",speed ); repeat the process. As we reach to ‘*’ if ( message1.substring(0,1) == "*" ) direction="right";set direction to right so else condition satisfy and we subtract two spaces from message1 and assign to message2 message2="  "+message1.substring( 0,message1.length-2 ); and display it at status bar by window.status = message2;. And repeat process to ‘*’ and set direction to left if ( message1.substring( message1.length-1,message1.length ) == "*" )  direction= "left"; in this way we can bounce our message at status bar

// More JavaScript - Visit: http://www.xfunda.com/
// JavaScript Message Marquee at Status Bar of web browser
<!--  
 
var data = " My  Bouncing  Message ... !!!  ";        // Message to be display
var limit="                        ";      // define bounce limit
var message1=limit+'*'+data+'*'+limit;
var direction = "left";
var speed = 75;  
 
function bounce()
{
if (direction == "left")
{
message2=message1.substring(2,message1.length)+"  ";
window.status=message2;
setTimeout("bounce();",speed);
message1=message2;
if (message1.substring(0,1) == "*")
direction="right";
}
else
{
message2="  "+message1.substring(0,message1.length-2);
window.status=message2;
setTimeout("bounce();",speed);
message1=message2;
if (message1.substring(message1.length-1,message1.length) == "*")
direction="left";
}
}
bounce()
// -->

JavaScript Bouncing Marquee text scroll at Status Bar of web browser
JavaScript Bouncing Marquee text scroll at Status Bar of web browser

Implementing Script

Implementation of script is quite simple just copy it and paste it any where in <head>--</head> or <body>--</body> section of your webpage.

 

Trackback(0)
Comments (0)Add Comment

Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
smile
wink
laugh
grin
angry
sad
shocked
cool
tongue
kiss
cry
smaller | bigger

busy
Last Updated ( Sunday, 17 May 2009 13:06 )  

Who's Online

We have 19 guests online

Subscribe Feeds

Enter your email address:

Sponsor Adds



Submit Article

We want to develop such a Community portal which will provide a good resource on latest hot technologies such as .NET, VB.NET, C#.NET, ADO.NET, ASP.NET, PHP, Flash, Photoshop. If you like to write for us, this guideline for you. please send your article, faqs on admin[at]xfunda.com

Adobe Gallery Photoshop Tutorials...

Navi Avatar Photo Manipulation with Photoshop Navi Avatar Photo Manipulation with Photoshop Navi Avatar Photo Manipulation with Photoshop Categoty - Photoshop >> Photo Effects. ...
 
Gunshot Through a Glass Photoshop Tutorial Gunshot Through a Glass Photoshop Tutorial Gunshot Through a Glass Photoshop Tutorial Categoty - Photoshop >> Photo Effects. ...
 
How to Create an Abstract Image in Photoshop How to Create an Abstract Image in Photoshop How to Create an Abstract Image in Photoshop Categoty - Photoshop >> illustration and Art. ...
 
How to Create a Clean 3D Notepad in Photoshop How to Create a Clean 3D Notepad in Photoshop How to Create a Clean 3D Notepad in Photoshop Categoty - Photoshop >> illustration and Art. ...
 
Create an Amazing website Layout Using Textures Create an Amazing website Layout Using Textures Create an Amazing website Layout Using Textures Categoty - Photoshop >> Website Designing. ...