Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-05-2002, 08:45 PM   PM User | #1
helpplease
New Coder

 
Join Date: Jul 2002
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
helpplease is an unknown quantity at this point
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 10:23 PM..
helpplease is offline   Reply With Quote
Old 08-06-2002, 09:27 PM   PM User | #2
helpplease
New Coder

 
Join Date: Jul 2002
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
helpplease is an unknown quantity at this point
Does anyone have any ideas? I'm stuck!
Help!
helpplease is offline   Reply With Quote
Old 08-06-2002, 09:42 PM   PM User | #3
adios
Senior Coder

 
Join Date: Jun 2002
Posts: 1,404
Thanks: 2
Thanked 32 Times in 32 Posts
adios is on a distinguished road
Help:

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


<a onmouseover="it=0;initialize()" onmouseout="......
adios is offline   Reply With Quote
Old 08-06-2002, 09:45 PM   PM User | #4
helpplease
New Coder

 
Join Date: Jul 2002
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
helpplease is an unknown quantity at this point
Awesome! Thanks so much!
helpplease is offline   Reply With Quote
Old 08-06-2002, 11:19 PM   PM User | #5
helpplease
New Coder

 
Join Date: Jul 2002
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
helpplease is an unknown quantity at this point
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.
helpplease is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:09 AM.


Advertisement
Log in to turn off these ads.