Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need to make this script a mouseover instead of an onload

    Hi,
    I found this script at:
    http://www.dynamicdrive.com/dynamicindex10/text5.htm
    I really like it and would like to make it a mouseover for a text link, instead of an onload action.

    I have modified it so that the mouseover works and the mouseout, but when you mouseover and then out and then back again, it doesn't work.
    Help!


    <html>
    <head>
    <script language="JavaScript1.2">

    var it=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(it))
    if (it<mytext.length-1){
    it++
    setTimeout("typeit()",100)
    }
    else
    return
    }
    function stop(){
    document.all.typing.style.visibility="hidden"
    }
    </script>
    </head>

    <body>


    <table>
    <tr>
    <td>
    <small><span id="typing" style="visibility:hidden" align="left">Welcome to Dynamic Drive...></small>
    </td>
    </tr>
    <tr>
    <td>
    <a onmouseover="initialize()" onmouseout="stop()" href="http://www.msn.com">help</a>
    </td>
    </tr>
    </table>
    </body>
    </html>
    Last edited by helpplease; 08-05-2002 at 11:23 PM.

  • #2
    New Coder
    Join Date
    Jul 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Does anyone have any ideas? I'm stuck!
    Help!

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    Help:

    var it;
    function initialize(){
    mytext=typing.innerText
    ........


    <a onmouseover="it=0;initialize()" onmouseout="......

  • #4
    New Coder
    Join Date
    Jul 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Awesome! Thanks so much!

  • #5
    New Coder
    Join Date
    Jul 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi! I have another question...
    How would I make multiple rollover text links using the same Javascript code but using different links and text in the <span>??

    Thanks.


  •  

    Posting Permissions

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