Search - Articles - Dev Forums - Favorites - Member Login
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009


Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

Build the right apps the right way with powerful development tools.
Visual Studio 2010. Learn more...
Render Text on Status bar Using JavaScript

Author: DevASP
Download Source Code : 538_StatusBarText.zip

This article is about how you can create a web page that have text on its status bar which continuously moves on the status bar. This is an easy way to get your user attraction to your web page.

  • Steps you will do. 
  • Start visual studio and create a new web application. 
  • Add the following JavaScript functions before closing the head tag.

 

<SCRIPT language=JavaScript>

 

var yourwords = "* Welcome to our DEVASP *";

var buffer1="                        ";

var buffer2="                        ";

var message1=buffer1+yourwords+buffer2;

var dir = "left";

var speed = 75;

function pingpong()

{

if (dir == "left")

  {

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

    window.status=message2;

    setTimeout("pingpong();",speed);

    message1=message2;

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

 

dir="right";

  }

 

else

 

  {

 

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

    window.status=message2;

    setTimeout("pingpong();",speed);

    message1=message2;

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

 

  }

 

}

</SCRIPT>

 

 

 

Add the following HTML code to design your web page and call the above JavaScript functions.

 

<body MS_POSITIONING="GridLayout" onLoad="pingpong()" bgcolor=#009999>

 

    <form id="Form1" method="post" runat="server">

            <center>

            <H4>Dont forget to visit www.devasp.com</H4>

`           <a href="http://www.devasp.com">Devasp Team</a>

            </center>

    </form>

 

</body>

 

  

NOTE: You can also change the text. To change the text change it in the first line of JavaScript code.

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< Change the Background Image of Your Web Form Programmatically

Disclaimer - Privacy
© 2002-2010 DevASP.net