#1
  1. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,283
    Rep Power
    13

    Javascript Question


    i have the script below that display text char by char inside a border and i was wondering how can i make it when it goes to the end of the border to clear the text that has inside it and then start displaying the rest of the text?
    How can i do it? Thanks in advance!

    <html><head><title></title>
    <script type="text/javascript">
    var textToShow = "$data";
    var pos = 0;
    var tm;

    function init()
    { tm = setInterval("type()", 50) }

    function type()
    {
    if (textToShow.length != pos)
    {
    d = document.getElementById("DivText");
    c = textToShow.charAt(pos++);
    if (c.charCodeAt(0) != 10)
    d.appendChild(document.createTextNode(c));
    else
    d.appendChild(document.createElement("br"));
    }
    else
    clearInterval(tm);
    }
    </script>

    <center><font size=5 color=Lime>- Λόγος Ψυχοφελής και Θαυμάσιος -<br><br>
    <body onload=javascript:init()>
    <center>
    <div id="DivText" align="Left" style="
    background: url(../images/blueblack.jpg);
    border-color: Yellow;
    border-style: Groove;
    border-width: 10;
    width: 900;
    height: 500;
    color: LightBlue;
    font-face: Com;
    font-size: 18">
    </div>
    </body>
    </html>
    ENDOFHTML
  2. #2
  3. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,283
    Rep Power
    13
    any help would be appreciated!

IMN logo majestic logo threadwatch logo seochat tools logo