Results 1 to 4 of 4

Thread: Typewriter effect

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2002
    Location
    Hampton Beach
    Posts
    513

    Question Typewriter effect

    I want to display my recordset in a typewriter effect. Types out the first record and then the second record underneath.. anyone know how to do this?

  2. #2
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994
    Well, load the entire thing into a JS array, and use a JavaScript timer to control when to display when you want something 'typed'. - I made an image shifter example for someone else further down this forum, try doing a search for it... Should hold all the examples you need(with and without a DB).

    Cheers!
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  3. #3
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    You can use some HTML in there too if you want:
    Code:
    var count = 0
    function initialize(){
    mytext=typing.innerText
    var myheight=typing.offsetHeight
    typing.innerText=''
    document.all.typing.style.height=myheight
    document.all.typing.style.visibility="visible"
    typeit()
    }
    function typeit(){
    typing.insertAdjacentText("beforeEnd",mytext.charAt(count))
    if (count<mytext.length-1){
    it++
    setTimeout("typeit()",70)
    }
    else
    return
    }
    if (document.all)
    document.body.onload=initialize
    
    <!-- HTML -->
    <span id="typing" style="visibility:hidden" align="left">This is the stuff here you want to have type...</span>
    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  4. #4
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    change:
    document.all.typing.style.height=myheight
    document.all.typing.style.visibility="visible"

    to:
    document.getElementById('typing').style.height=myheight
    document.getElementById('typing').style.visibility="visible"

    to make it work in more browsers.
    Have I helped you? Please Rate my posts.

Posting Permissions

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



Click Here to Expand Forum to Full Width