Metachecker.net
|
FontsMadeEasy.com
|
RankChecker.net
Learn Java Script Today
|
Over 5000 Free Fonts
|
Tutorials
|
Javascript Forum
|
Other Javascript Resources
|
Cheat Sheet
JavaScript Basics
Inserting Javascript
Complete Tutorial
Advance DHTML Tutorial
Script archive
Advanced Tutorials
Alert Scripts
Animation
Audio
Background Effects
Banner Ads
Browser Window
Buttons
Button Forms
Calculcators
Calendars
Clocks & Dates
Cookies
Cursor Effects
DHMTL Games
DHTML Miscellaneous
Equivalents
Forms
Games
IE4+ Scripts
IE5+ Scripts
Image Effects
Image Miscellaneous
Links & Buttons
Math Related
Messages Miscellaneous
Miscellaneous
Mouse Tricks
Navigation
Page Details
Password Protection
Pulldown Menus
Random Stuff
Scrolling
Status Bar
Text Animation
User Detail
User Info
Window Control
Random Status Bar Scroller
This type of scroller desplays the message in a random manner.
Insert into <HEAD>
<script language="JavaScript"> <!-- Hide from old browsers var speed = 10 var pause = 1500 var timerID = null var bannerRunning = false var ar = new Array() ar[0] = "MESSAGE #1" ar[1] = "MESSAGE #2" ar[2] = "MESSAGE #3" ar[3] = "MESSAGE #4" var message = 0 var state = "" clearState() function stopBanner() { if (bannerRunning) clearTimeout(timerID) bannerRunning = false } function startBanner() { stopBanner() showBanner() } function clearState() { state = "" for (var i = 0; i < ar[message].length; ++i) { state += "0" } } function showBanner() { if (getString()) { message++ if (ar.length <= message) message = 0 clearState() timerID = setTimeout("showBanner()", pause) bannerRunning = true } else { var str = "" for (var j = 0; j < state.length; ++j) { str += (state.charAt(j) == "1") ? ar[message].charAt(j) : " " } window.status = str timerID = setTimeout("showBanner()", speed) bannerRunning = true } } function getString() { var full = true for (var j = 0; j < state.length; ++j) { if (state.charAt(j) == 0) full = false } if (full) return true while (1) { var num = getRandom(ar[message].length) if (state.charAt(num) == "0") break } state = state.substring(0, num) + "1" + state.substring(num + 1, state.length) return false } function getRandom(max) { return Math.round((max - 1) * Math.random()) } // -- End Hiding Here --> </script>
Insert into <BODY>
<body onLoad="startBanner()">
Other Options
An example is: <BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#000080" ALINK="#000080" onLoad="startBanner()"> or <body oonLoad="startBanner()"> If you want to add more messages, you'll need to insert the following line. it is the same as the ones all ready in the code, just with a different number and message. For example, if you wanted a fifth message, the line that you would insert would be.... (These goes after the lines of code that look just like it.) ar[5] = "MESSAGE #5" Notice how the menu number increased!