Deprecated: Assigning the return value of new by reference is deprecated in /home/content/48/9096548/html/xfunda.com/components/libraries/cmslib/spframework.php on line 76

Deprecated: Assigning the return value of new by reference is deprecated in /home/content/48/9096548/html/xfunda.com/components/libraries/cmslib/spframework.php on line 571

Deprecated: Assigning the return value of new by reference is deprecated in /home/content/48/9096548/html/xfunda.com/components/libraries/cmslib/spframework.php on line 572

Deprecated: Assigning the return value of new by reference is deprecated in /home/content/48/9096548/html/xfunda.com/components/libraries/cmslib/spframework.php on line 580

Deprecated: Function eregi() is deprecated in /home/content/48/9096548/html/xfunda.com/templates/ja_barite/ja_menus/Base.class.php on line 62
JavaScript Status Bar Left to right Text scroll

Excellent Fundamental...!!!

 
  • Increase font size
  • Default font size
  • Decrease font size
  • default color
  • green color
  • blue color

JavaScript Status Bar Left to right Text scroll

E-mail Print PDF

JavaScript Status Bar Left to right Text scroll

In this article we are going to design a JavaScript Left to right text scroll at windows Status Bar. Take a look below on piece of code…

 

var YourMess = "TechXcel.com - provides technical excellence... ";
var space = "";
var msg = "";
var LeftMsg = "";
function MsgFLY(){

    if (msg == "")
{
    space = " ";
    msg = YourMess;
    LeftMsg = "";
}

    if (space.length == 1)
{
    while (msg.substring(0, 1) == " ")
    {
    LeftMsg = LeftMsg + space;
    space = msg.substring(0, 1);
    msg = msg.substring(1, msg.length);
    }
    LeftMsg = LeftMsg + space;
    space = msg.substring(0, 1);
    msg = msg.substring(1, msg.length);
        for (var ii = 0; ii < 120; ii++)
    {
    space = " " + space;
    }
}
else
    space = space.substring(10, space.length);
    window.status = LeftMsg + space;
    timeout = window.setTimeout('MsgFLY()',100);
}
timeout = window.setTimeout('MsgFLY()',500);

Now we define a function MsgFLY() and going to call it through Window object supports methods setTimeout() to call same function after every 1000 milliseconds. The Window object supports methods for setting timers that we might use to perform a variety of functions. These methods include setTimeout() and clearTimeout(). The basic idea is to set a timeout to trigger a piece of script to occur at a particular time in the future. The general syntax is
 timerId = setTimeout(script-to-execute, time-in-milliseconds);

As the MsgFLY() get called after every 500 milliseconds recursively. Here we have define 4 variables… YourMess, space,msg, Leftmsg. And then assign YourMess text to msg and a blank space to space. Now we are going to split our message to display at status bar by using msg.substring. msg.substring extracts characters

Syntax:
substring(A, [B])

Parameters:
A : An integer between 0 and one less than the length of the string.
B : (optional) An integer between 0 and the length of the string.

substring extracts characters from indexA up to but not including indexB. In particular:

If A equals B, substring returns an empty string.
If B is omitted, substring extracts characters to the end of the string.
If either argument is less than 0 or is NaN, it is treated as if it were 0.
If either argument is greater than stringName.length, it is treated as if it were stringName.length.

For example: -
// assumes a print function is defined
var anyString = "TechXcel";
// Displays "Tech"
print(anyString.substring(0,4));


And then we are adding blank space to it and then display it at status bar of web browser. see image below...

JavaScript Digital clock

example:

Please download Source Code and test it ...

Source Code:

Download Source code for 'Status Bar Left to Right TextScroll'

Download

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
 

Articles


Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a reference, value given in /home/content/48/9096548/html/xfunda.com/libraries/joomla/cache/handler/callback.php on line 100

Adobe Gallery


Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a reference, value given in /home/content/48/9096548/html/xfunda.com/libraries/joomla/cache/handler/callback.php on line 100

Community


Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a reference, value given in /home/content/48/9096548/html/xfunda.com/libraries/joomla/cache/handler/callback.php on line 100

FAQ's


Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a reference, value given in /home/content/48/9096548/html/xfunda.com/libraries/joomla/cache/handler/callback.php on line 100

Resources


Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a reference, value given in /home/content/48/9096548/html/xfunda.com/libraries/joomla/cache/handler/callback.php on line 100

Who's Online

We have 26 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...

Photoshop Tutorial - Create Colorful Composition in Photoshop Photoshop Tutorial - Create Colorful Composition in Photoshop Photoshop Tutorial - Create Colorful Composition in Photoshop Category - Photoshop >> illustration and Art. ...
 
Photoshop Tutorial - Create a Nice Autumn Scenery in Photoshop Photoshop Tutorial - Create a Nice Autumn Scenery in Photoshop Photoshop Tutorial - Create a Nice Autumn Scenery in Photoshop Category - Photoshop >> illustration and Art. ...
 
Photoshop Tutorial - Create a Beautiful Lonely Fantasy Fairy Photoshop Tutorial - Create a Beautiful Lonely Fantasy Fairy Photoshop Tutorial - Create a Beautiful Lonely Fantasy Fairy Category - Photoshop >> illustration and Art. ...
 
Photoshop Tutorial - How To Create a Futuristic Sci-Fi Scene Photoshop Tutorial - How To Create a Futuristic Sci-Fi Scene Photoshop Tutorial - How To Create a Futuristic Sci-Fi Scene Category - Photoshop >> Photo Effects. ...
 
Photoshop Tutorial - Goddess cadeira photo effect in Photoshop Photoshop Tutorial - Goddess cadeira photo effect in Photoshop Photoshop Tutorial - Goddess cadeira photo effect in Photoshop Category - Photoshop >> Photo Effects. ...