Results 1 to 2 of 2

Thread: Single display line rotating/scroll text display.

  1. #1
    Join Date
    Jul 2006
    Posts
    64
    Thanks
    22
    Thanked 0 Times in 0 Posts

    Default Single display line rotating/scroll text display.

    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.

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Code:
    <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>
    - Mike

  3. The Following User Says Thank You to mburt For This Useful Post:

    acctman (08-29-2008)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •