S
scowat
I am dynamically updating the contents of cells to achieve a scrolling
effect, like this:
<html>
<body>
<script lang=javascript>
function scroll(){
var firstrowcell1 = document.getElementById('1-1').innerHTML;
var firstrowcell2 = document.getElementById('1-2').innerHTML;
for (var x = 1; x < 3; x ++)
{
document.getElementById(x+'-1').innerHTML = document.getElementById((x
+1)+'-1').innerHTML;
document.getElementById(x+'-2').innerHTML = document.getElementById((x
+1)+'-2').innerHTML;
}
document.getElementById(x+'-1').innerHTML = firstrowcell1;
document.getElementById(x+'-2').innerHTML = firstrowcell2;
}
function scrollcont(){
setInterval('scroll()',1000);
}
function showinnerhtml(){
alert(document.getElementById("1-2").innerHTML);
}
</script>
<table>
<tr>
<td id='1-1'>Line 1</td>
<td id='1-2'><img src='numbers/1.gif' onmouseover="return escape('This
is line 1')"></td>
</tr>
<tr>
<td id='2-1'>Line 2</td>
<td id='2-2'><img src='numbers/2.gif' onmouseover="return escape('This
is line 2')"></td>
</tr>
<tr>
<td id='3-1'>Line 3</td>
<td id='3-2'><img src='numbers/3.gif' onmouseover="return escape('This
is line 3')"></td>
</tr>
</table>
<button onclick=scroll()>Scroll 1 line</button><br>
<button onclick=scrollcont()>Scroll continuously</button><br>
<button onclick=showinnerhtml()>Show innerHTML</button>
<script language="JavaScript" type="text/javascript" src="scripts/
wz_tooltip.js"></script>
</body>
</html>
I am also using Walter Zorn's tooltip script. When I first load the
page, the tooltips on the images work fine when onmouseover fires.
However, after a single scroll, tooltips fail to appear. I have
discovered that this is because the innerHTML that is being copied
from one cell to the the other doesn't contain onmouseover
information.
By clicking on the button marked 'Show innerHTML' I can see that the
innerHTML attribute doesn't return the onmouseover information
contained in the tag.
Can anyone shed some light on this? Any replies would be greatly
appreciated - thanks!
effect, like this:
<html>
<body>
<script lang=javascript>
function scroll(){
var firstrowcell1 = document.getElementById('1-1').innerHTML;
var firstrowcell2 = document.getElementById('1-2').innerHTML;
for (var x = 1; x < 3; x ++)
{
document.getElementById(x+'-1').innerHTML = document.getElementById((x
+1)+'-1').innerHTML;
document.getElementById(x+'-2').innerHTML = document.getElementById((x
+1)+'-2').innerHTML;
}
document.getElementById(x+'-1').innerHTML = firstrowcell1;
document.getElementById(x+'-2').innerHTML = firstrowcell2;
}
function scrollcont(){
setInterval('scroll()',1000);
}
function showinnerhtml(){
alert(document.getElementById("1-2").innerHTML);
}
</script>
<table>
<tr>
<td id='1-1'>Line 1</td>
<td id='1-2'><img src='numbers/1.gif' onmouseover="return escape('This
is line 1')"></td>
</tr>
<tr>
<td id='2-1'>Line 2</td>
<td id='2-2'><img src='numbers/2.gif' onmouseover="return escape('This
is line 2')"></td>
</tr>
<tr>
<td id='3-1'>Line 3</td>
<td id='3-2'><img src='numbers/3.gif' onmouseover="return escape('This
is line 3')"></td>
</tr>
</table>
<button onclick=scroll()>Scroll 1 line</button><br>
<button onclick=scrollcont()>Scroll continuously</button><br>
<button onclick=showinnerhtml()>Show innerHTML</button>
<script language="JavaScript" type="text/javascript" src="scripts/
wz_tooltip.js"></script>
</body>
</html>
I am also using Walter Zorn's tooltip script. When I first load the
page, the tooltips on the images work fine when onmouseover fires.
However, after a single scroll, tooltips fail to appear. I have
discovered that this is because the innerHTML that is being copied
from one cell to the the other doesn't contain onmouseover
information.
By clicking on the button marked 'Show innerHTML' I can see that the
innerHTML attribute doesn't return the onmouseover information
contained in the tag.
Can anyone shed some light on this? Any replies would be greatly
appreciated - thanks!