...

View Full Version : want to make this script a mouseover instead of an onload



helpplease
08-05-2002, 08:45 PM
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>

helpplease
08-06-2002, 09:27 PM
Does anyone have any ideas? I'm stuck!
Help!

adios
08-06-2002, 09:42 PM
Help:

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


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

helpplease
08-06-2002, 09:45 PM
Awesome! Thanks so much! :thumbsup:

helpplease
08-06-2002, 11:19 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum