This code will help you to add scrolling status bar in webpage. just edit the text as per your requirement and get the power of JavaScript.
You can change the scrolling speed also.
Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_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>Scrolling In Status Bar</title>
<script language="JavaScript">
var Count = 0;
var Text = "CSharpTalk.com Tutorials.";
var Speed = 90;
var timerID = null;
var TimerRunning = false;
var i = 0;
while (i ++ < 140) Text = " " + Text;
function Scroll()
{
window.status = Text.substring(Count++, Text.length);
if (Count == Text.length)
Count = 0; timerID = setTimeout("Scroll()", Speed);
TimerRunning = true;
}
function Start()
{
Stop();
Scroll();
}
function Stop()
{
if(TimerRunning)
clearTimeout(timerID);
TimerRunning = false;
}
Start();
</script>
</head>
<body>
</body>
</html>
1 comments: