Rotation test revamped

This commit is contained in:
vidur%netscape.com 1998-07-16 23:39:08 +00:00
parent 2ef5aa2ece
commit e4c8079dac
2 changed files with 39 additions and 23 deletions

View File

@ -2,21 +2,24 @@
<BODY>
<P>
Let's start with some text, have a <B>bold element</B>, an <I>italicized element</I> and then an image:
<IMG SRC="http://zabadubop/layers/tests/mzcolor.gif">.
And now a lot more text. And now a lot more text. And now a lot more text.
And now a lot more text. And now a lot more text. And now a lot more text.
And now a lot more text. And now a lot more text. And now a lot more text.
And now a lot more text. And now a lot more text. And now a lot more text.
And now a lot more text. And now a lot more text. And now a lot more text.
And now a lot more text. And now a lot more text. And now a lot more text.
And now a lot more text. And now a lot more text. And now a lot more text.
And now a lot more text. And now a lot more text. And now a lot more text.
<IMG SRC="http://www.caboodles.com/clipart/archives/alt_bin/transport/car13.gif" width=100 height=80>
<font color="#0000FF">And now a lot more text. And now a lot more text. And now a lot more text.</font>
And now a lot more text. And now a lot more text. And now a lot more text.
<font color="#FF0000">And now a lot more text. And now a lot more text. And now a lot more text.</font>
And now a lot more text. And now a lot more text. And now a lot more text.
<font color="#00FF00">And now a lot more text. And now a lot more text. And now a lot more text.</font>
And now a lot more text. And now a lot more text. And now a lot more text.
<font face="Arial, Helvetica, sans-serif">And now a lot more text. And now a lot more text. And now a lot more text. </font>
<font face="Verdana, Arial, Helvetica, sans-serif">And now a lot more text. And now a lot more text. And now a lot more text. </font>
And now a lot more text. And now a lot more text. And now a lot more text.
<font face="Times New Roman, Times, serif">And now a lot more text. And now a lot more text. And now a lot more text. </font>
And now a lot more text. And now a lot more text. And now a lot more text.
<table border=2>
<tr><td><center><IMG SRC="http://zabadubop/layers/tests/mzcolor.gif">A table!</center></td><td><center>You're a brave man, Kipp.</center></td></tr>
<tr><td><center>And more text.</center></td><td><center>And still more text.</center></td></tr>
</table>
And now a lot more text. And now a lot more text. And now a lot more text.
<font size=6>And now a lot more text. And now a lot more text. And now a lot more text. </font>
And now a lot more text. And now a lot more text. And now a lot more text.
And now a lot more text. And now a lot more text. And now a lot more text.
And now a lot more text. And now a lot more text. And now a lot more text.

View File

@ -18,22 +18,35 @@
var body = document.documentElement.childNodes[1];
var para = body.childNodes[1];
var image = para.childNodes[5];
var img1 = para.childNodes[5];
var tbody = body.childNodes[2].childNodes[1];
var tparent = tbody.childNodes[0].childNodes[0];
var img2 = tparent.childNodes[0].childNodes[0];
var pos = 0;
function rotate() {
dump("Removing\n");
para.removeChild(image);
dump("Getting child " + pos + "\n");
var child = para.childNodes[pos++];
if (pos == para.childNodes.length) {
pos = 0;
}
dump("Inserting\n");
para.insertBefore(image, child);
dump("Done\n");
function rotate(p, c) {
p.removeChild(c);
var child = p.childNodes[pos++];
if (pos > p.childNodes.length) {
pos = 0;
}
p.insertBefore(c, child);
}
//rotate();
setInterval(rotate, 2000);
function rotate2() {
tparent.childNodes[0].removeChild(img2);
if (tparent.nextSibling != null) {
tparent = tparent.nextSibling;
}
else if (tparent.parentNode.nextSibling != null) {
tparent = tparent.parentNode.nextSibling.childNodes[0];
}
else {
tparent = tbody.childNodes[0].childNodes[0];
}
tparent.childNodes[0].insertBefore(img2, tparent.childNodes[0].childNodes[0]);
}
var int1 = setInterval(rotate, 1000, para, img1);
var int2 = setInterval(rotate2, 1000)