Tip

Banner In Status Bar Of The Browser

Displaying the banner in the status bar of the Browser using Javascript

Create a form and add the Javascript function StatusBarBanner() to the JSHeader
of the form. Call the function StatusBarBanner(10) with a numeric value as
an argument. The text you want to display in the browser status bar which
scrolls, For that assign the strings to the array's elements and the function
uses
expression assigned containing recursive call with literal argument in form of
string.

Call the function "Onload" event of the form as StatusBarBanner(10).
function StatusBarBanner(ok) {
// set pause in milliseconds between movement
var speed = 80

// assign one-space string to variable (space pads left side of status bar)
var str = " "

// create global array
var ar = new Array()

// assign the strings to the array's elements
ar[0] = "********Welcome to Our new Services*******"
ar[1] = "If you are creating a document for the first time. "
ar[2] = "Here are a few helpful tips to make completing this application a
little easier."
ar[3] = "1. Anytime you see a Bullet , it means that you must enter the
corresponding information in order to continue. It is required information."

// join all messages to one string variable with no delimiter
var total = ar.join("")

// if message has not yet reached the left side of the status bar
if (ok > 0) {
// assign string of ok spaces to variable
for (var i = 0; i < ok; ++i) {
str += " "
}

// append message to end of output string
str += total

// message moved one position to the left
ok--

// assign expression containing recursive call with literal argument in form
of string
var cmd = "StatusBarBanner(" + ok + ")"

// place computed message in status bar
window.status = str

// recursive call after speed milliseconds
timerID = setTimeout(cmd, speed)
} else
// if a substring of the total message still remains in status bar
if (-ok < total.length) {
// assign part of message that has not slided off the left
str += total.substring(-ok, total.length)

// message has moved one position to the left
ok--

// assign expression containing recursive call with literal argument in form
of string
var cmd = "StatusBarBanner(" + ok + ")"

// place computed message in status bar
window.status = str

// recursive call after speed milliseconds
timerID = setTimeout(cmd, speed)
} else {
// assign a one-space string to status bar
window.status = str

// recursive call after speed milliseconds at initial position
timerID = setTimeout("StatusBarBanner(100)", speed)
}
}

This was first published in November 2000

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.