Closed Bug 85278 Opened 23 years ago Closed 23 years ago

rotating images via looping method does not work...

Categories

(Core :: JavaScript Engine, defect)

x86
Windows NT
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 74993

People

(Reporter: webmstr, Assigned: rogerl)

Details

Using the following code, rotaing images does not work:
<html>
<head>
<script language = "JavaScript">
<!--
delay = 10000;
imageNum = 1;
dvlpr_image = new Array()
for (i=1; i < 9; i++)
{
        dvlpr_image[i] = new Image();
        dvlpr_image[i].src = "images/desk" + i + ".jpg";
}
imageNum = 1;
function swtch()
{
        document.dvlpr_swtch.src = dvlpr_image[imageNum].src;
        imageNum++;
        if (imageNum > 8)
        {
                imageNum = 1;
        }
      window.status = 'Time Delay is: ' + delay + ' ms';
}
function slow_down()
{
        delay+=1000;
        if (delay > 10000) delay = 10000;
      window.status = 'Time Delay Set to: ' + delay + ' ms';
}
function speed_up()
{
        delay-=1000;
        if (delay < 0) delay = 0;
      window.status = 'Time Delay Set to: ' + delay + ' ms';
}
// -->
</script>
</head>

<body>

<img NAME="dvlpr_swtch" SRC="images/desk0.jpg" ALT="[dvlpr logos]" 
onLoad="setTimeout('swtch()', delay)">

<form>
<input type="button" value="Slower" onClick="slow_down()">
<input type="button" value="Faster" onClick="speed_up()">
</form>
</body>
</html>
Actually, the problem is just that the onload handler only fires once....

*** This bug has been marked as a duplicate of 74993 ***
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
Verified Duplicate -
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.