ScrollText in StatusBar in asp.net

Satyapriyanayak
Posted by Satyapriyanayak under ASP.NET category on | Points: 40 | Views : 994
Method-1

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Javascript_ScrollText_in_asp.net.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script lang="javascript">
<!--
var current=0;
var x = 0;
var speed = 150;
var speed2 = 150;
function startarray(n)
{
this.length = n;
for(var i =1; i <=n; i++)
{
this[i]="";
}
}
dis_letters= new startarray(1);
dis_letters[0]="Website Created By Satyapriya Nayak";

function display_letters()
{
var m = dis_letters[current];
window.status = m.substring(0,x++) + "";
if (x == m.length + 1)
{
x=0;
current++;
if (current > dis_letters.length-1)
{
current=0;
}

setTimeout("display_letters()",speed2);

}
else
{
setTimeout("display_letters()",speed);
}
}
display_letters();
-->
</script>
</head>
<body>
<form id="form1" runat="server">
<div>

</div>
</form>
</body>
</html>




Method-2

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Javascript_ScrollText_in_asp.net._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
msg="This is an example of scrolling message";
spacer="............ .............";
pos=0;
function ScrollMessage()
{
window.status=msg.substring(pos,msg.length)+spacer+
msg.substring(0,pos);
pos++;
if(pos>msg.length)pos=0;
window.setTimeout("ScrollMessage()",100);
}
ScrollMessage();
</script>
</head>
<body>
<form id="form1" runat="server">
<div>

</div>
</form>
</body>
</html>

Comments or Responses

Login to post response