Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

BBS: triggering a javascript animation on another layer - September 14, 1998 at 05:16:13

You are here: irt.org | BBS | triggering a javascript animation on another layer [This BBS is closed]

Posted by Yvan Gagnon on September 14, 1998 at 05:16:13:

Anyone here know how I would modify the code below so that it triggers the animation on a
different layer?

<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT LANGUAGE="JavaScript">

var timerID1 = 0;
var timerID2 = 0;
var timerID3 = 0;
var timerID4 = 0;
var timerID5 = 0;
var timerID6 = 0;
var timerID7 = 0;
var timerID8 = 0;

if ( document.images ) {
img1 = new Image ();
img1.src = "images/1.gif";
img2 = new Image ();
img2.src = "images/2.gif";
img3 = new Image ();
img3.src = "images/3.gif";
img4 = new Image ();
img4.src = "images/4.gif";
img5 = new Image ();
img5.src = "images/5.gif";
img6 = new Image ();
img6.src = "images/6.gif";
img7 = new Image ();
img7.src = "images/7.gif";
img8 = new Image ();
img8.src = "images/8.gif";
img9 = new Image ();
img9.src = "images/1x1.gif";

}

function startAnimation (i) {
if ( document.images )
play1 (i);
}

function stopAnimation (i) {
if ( document.images ) {
document.images[i].src = 'images/1x1.gif'
clearTimeout (timerID1);
clearTimeout (timerID2);
clearTimeout (timerID3);
clearTimeout (timerID4);
clearTimeout (timerID5);
clearTimeout (timerID6);
clearTimeout (timerID7);
clearTimeout (timerID8);
clearTimeout (timerID9);
}
}

function play1 (imgNum) {
document.images[imgNum].src = "images/1.gif";
timerID1 = setTimeout ("play2 (0)",125);
}
function play2 (imgNum) {
document.images[imgNum].src = "images/2.gif";
timerID2 = setTimeout ("play3 (0)",125);
}
function play3 (imgNum) {
document.images[imgNum].src = "images/3.gif";
timerID3 = setTimeout ("play4 (0)",125);
}
function play4 (imgNum) {
document.images[imgNum].src = "images/4.gif";
timerID4 = setTimeout ("play5 (0)",125);
}
function play5 (imgNum) {
document.images[imgNum].src = "images/5.gif";
timerID5 = setTimeout ("play6 (0)",125);
}
function play6 (imgNum) {
document.images[imgNum].src = "images/6.gif";
timerID6 = setTimeout ("play7 (0)",125);
}
function play7 (imgNum) {
document.images[imgNum].src = "images/7.gif";
timerID7 = setTimeout ("play8 (0)",125);
}
function play8 (imgNum) {
document.images[imgNum].src = "images/8.gif";
timerID8 = setTimeout ("play9 (0)",125);
}
function play9 (imgNum) {
document.images[imgNum].src = "images/1x1.gif";
timerID9 = setTimeout ("play1 (0)",200);
}

</SCRIPT>
</HEAD>

<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000"
VLINK="#800000"
ALINK="#FF00FF" BACKGROUND="?">

<a href="#" onMouseover="startAnimation (0)"
onMouseout="stopAnimation (0)"><IMG SRC="images/1x1.gif" WIDTH="48"
HEIGHT="78" border=0></a>

</BODY>
</HTML>

*********************

Thanks,
-- yvan@intersolutions.com
Follow-ups:

You are here: irt.org | BBS | triggering a javascript animation on another layer [This BBS is closed]

©2018 Martin Webb