chris_angell
02-28-2003, 12:41 PM
hello. I am trying to get two boxes of text to type pain text in two areas, I have done some code and assigned two lots of text typing into boxes.. but if you run the code, in the second box it is going crazy.. what can I do ??? any ideas.. i can't puzzle out the if statment ???
<html>
<head>
</head>
<body>
<script language="JavaScript1.2">
var it=0
function initialize(){
mytext=typing.innerText
mytext1=typing1.innerText
typing.innerText=''
typeit()
}
function typeit(){
typing.insertAdjacentText("beforeEnd",mytext.charAt(it))
typing1.insertAdjacentText("beforeEnd",mytext1.charAt(it))
if (it<mytext.length-1){
it++
setTimeout("typeit()",100)
}
else
return
}
if (document.all)
document.body.onload=initialize
</script>
<table border="1" cellspacing="1" width="100%" id="AutoNumber1">
<tr>
<td id="typing" width="100%">test typing</td>
</tr>
<tr>
<td id="typing1" width="100%">test typing 1</td>
</tr>
</table>
</body>
<html>
<head>
</head>
<body>
<script language="JavaScript1.2">
var it=0
function initialize(){
mytext=typing.innerText
mytext1=typing1.innerText
typing.innerText=''
typeit()
}
function typeit(){
typing.insertAdjacentText("beforeEnd",mytext.charAt(it))
typing1.insertAdjacentText("beforeEnd",mytext1.charAt(it))
if (it<mytext.length-1){
it++
setTimeout("typeit()",100)
}
else
return
}
if (document.all)
document.body.onload=initialize
</script>
<table border="1" cellspacing="1" width="100%" id="AutoNumber1">
<tr>
<td id="typing" width="100%">test typing</td>
</tr>
<tr>
<td id="typing1" width="100%">test typing 1</td>
</tr>
</table>
</body>