Log in

View Full Version : Single display line rotating/scroll text display.



acctman
08-04-2008, 01:40 AM
I'm looking for a script that will display text one line at a time. Example would be

Rule 1: something blah blah... <display 3-5 secs>
then roll up or clear and display
Rule 2: something blah blah... <display 3-5 secs>

and keep repeating for all the rules. I have limited space so I need to display 1 line at a time.

Thanks in advance.

mburt
08-04-2008, 03:25 AM
<input id="foo" type="text">
<script type="text/javascript">
$ = function(e) {return document.getElementById(e);};
var display = function(el) {
var msg = ["Message 1", "Message 2", "Message 3", "Message 4"],
e = $(el), c = "count",
timer = 3500;
if (typeof e[c] == "undefined") {
e[c] = -1;
};
if (e[c] > msg.length-2) {
e[c] = 0;
} else {
++e[c];
};
e["value"] = msg[e[c]];
var t = setTimeout(function() {display(el);}, timer);
};
display("foo");
</script>