C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Advanced JavaScript - Status bar effects Part 4


Posted Date: 28 Apr 2006    Resource Type: Articles    Category: General
Author: Chetankumar Digambarrao AkarteMember Level: Gold    
Rating: Points: 10



Introduction




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
 


Source Code



 

<SCRIPT language=JavaScript>

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()

</SCRIPT>





Summary


This artical gives an idea to add Bouncing Marquee at Status Bar of Web Browser





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Status Bar effects with Javascript  .  Status Bar effects using Javascript  .  Status Bar effects  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Advanced JavaScript - Status bar effects Part 3
Previous Resource: n - Tier Architecture in Asp.net
Return to Discussion Resource Index
Post New Resource
Category: General


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use