border: 1px solid #cccccc;
var speed = 4000
var selectedDivObj = document.getElementById("news" + activeDiv)
selectedDivObj.style.display = "block"
activeDiv =(activeDiv < divCount - 1 )? activeDiv + 1 : 0
while (document.getElementById("news" + divCount)!=null)
window.addEventListener("load", beginTicking, false)
else if (window.attachEvent)
There is a simple style sheet that you can use to style the three main elements of the news ticker.
The script that follows can comfortably be used as it is. The speed can be configured to your suiting. In this example the speed is set to 4 secs (4000 milliseconds).
The beginTicking() function sets up the next active DIV by incrementing the divCount variable which starts at zero. It then calls the third and final function showDiv().
showDiv() is the function ensures all DIVs are hidden then it takes the current DIV based on the divCount() and displays it for the duration configured using the variable speed above.