WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Bouncing Marquee at Status Bar
Categories : Java Script, HTML, Browsers
Chetankumar Akarte
Date : Dec 05th 2006
Grade : 4 of 5 (graded 6 times)
Viewed : 10488
File : 4546.zip
Images : Image 1
Search : More code by Chetankumar Akarte
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
Like this code?
Show the author your appreciation.
 

In this example I show how to add a bouncing message at the status bar of the browser.
Define the next variables :

o data - contains a message to be displayed
o limit - bounce limit
o message1
o direction
o speed

The function bounce() contains an if-else condition that bounces the message left or right.
To shift the message left we add two spaces to message1 and assign the value to message2 :

message2=message1.substring(2,message1.length)+"  ";


and display it at the status bar by

window.status=message2;


We refresh the message with

setTimeout("bounce();",speed);


and repeat the process.

As we reach ‘*’

if (message1.substring(0,1) == "*" ) direction="right";


we set the direction to the right so the else condition is satisfied and we subtract two spaces from message1 and assign the value to message2 :

message2="  "+message1.substring(0,message1.length-2);


and display it at the status bar with :

window.status=message2;


And repeat process to ‘*’ and set direction to the left :

if (message1.substring(message1.length-1,message1.length) == "*")  direction="left";


in this way we can bounce our message at the status bar


Full Code
<SCRIPT language=JavaScript type="text/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>



Message Marquee at Status Bar
Categories : Java Script, HTML, Browsers
Bookmarklets are simple tools that extend the surf and search capabilities of Netscape and Explorer web browsers.
Categories : Java Script, HTML, General
showing Help (assistance) to the user while filling html forms.
Categories : HTML, Java Script, Form Processing
Enchancing dd/mm/yyyy forms with unobtrusive javascript
Categories : Java Script, HTML, User Interface, Date Time
Conditional Check - a script that allows a user to submit a form only if the user check a checkbox.
Categories : HTML, Java Script, Form Processing, Beginner Guides
How to get the Focus (Cursor) into a Form-Element.
Categories : HTML, Java Script
Javascript linked dropdowns
Categories : Java Script, HTML, Classes and Objects
Javascript animated menu items
Categories : DHTML, CSS, Java Script, HTML
Flash Your Message at Status Bar
Categories : Java Script, Browsers
How to create <SELECT> menues that change on the fly according to other <SELECT> menues on the page?
Categories : Java Script, HTML
Check if Javascript is Enabled or Disabled - Works in all Browsers
Categories : Java Script, HTML, Web Browsers
Page Loading Message shown during the time your site's page is being loaded.
Categories : HTML, CSS, Java Script
Prevent Right Mouse steal your graphics
Categories : HTML, Java Script, Security
Javascript Background Scroller
Categories : Java Script, CSS, HTML
Get your browser details using javascript
Categories : Java Script, Beginner Guides, Browsers