W
Wade
08122005 1505 GMT-5
Hello. I am working on a webpage for the local school (just before
school starts). Their outside hired company really screwed things up.
Im trying to get their computers up and running and gain access to
their apps for them.
There is this code that flips through images for World History class. I
have removed the code from the page but the page still does not
function.
Im so very new to JS that while I understand what Im viewing, I do not
understand why it doesnt work.
Could somebody help me on this?
Wade
<HTML>
<HEAD>
<TITLE>CountDown</TITLE>
<script language="JavaScript">
<!-- hide from other browsers
//Pictures to switch inbetween
var Rollpic1 = "1.jpg"
var Rollpic2 = "2.jpg";
var Rollpic3 = "3.jpg";
var Rollpic4 = "4.jpg";
//Start at the what pic:
var PicNumber=AD1.png;
//Number of pics:
var NumberOfPictures=4;
//Time between pics switching in secs
var HowLongBetweenPic=5;
//SwitchPic Function
function SwitchPic(counter){
if(counter < HowLongBetweenPic){
counter++;
//DEBUG in the status bar at the bottom of the screen
window.status="Switch picture at 5 : "+counter+" PicNumber:
"+PicNumber+" ";
//Display pic in what <IMG> tag roll is what I called the image
document.roll.src = eval("Rollpic" + PicNumber);
//function calls itself
CallSwitchPic=window.setTimeout("SwitchPic("+counter+")",1500);
}
else{
//if its not the last picture goto the next picture
if(PicNumber < NumberOfPictures){
PicNumber++;
SwitchPic(0);
}
//its the last picture go to the first one
else{
PicNumber=1;
SwitchPic(0);
}
}
}
// Stop hiding from old browsers -->
</script>
</HEAD>
<BODY onLoad="SwitchPic(0)">
<img src="1.jpg" border="0" name="roll">
</BODY>
</HTML>
Hello. I am working on a webpage for the local school (just before
school starts). Their outside hired company really screwed things up.
Im trying to get their computers up and running and gain access to
their apps for them.
There is this code that flips through images for World History class. I
have removed the code from the page but the page still does not
function.
Im so very new to JS that while I understand what Im viewing, I do not
understand why it doesnt work.
Could somebody help me on this?
Wade
<HTML>
<HEAD>
<TITLE>CountDown</TITLE>
<script language="JavaScript">
<!-- hide from other browsers
//Pictures to switch inbetween
var Rollpic1 = "1.jpg"
var Rollpic2 = "2.jpg";
var Rollpic3 = "3.jpg";
var Rollpic4 = "4.jpg";
//Start at the what pic:
var PicNumber=AD1.png;
//Number of pics:
var NumberOfPictures=4;
//Time between pics switching in secs
var HowLongBetweenPic=5;
//SwitchPic Function
function SwitchPic(counter){
if(counter < HowLongBetweenPic){
counter++;
//DEBUG in the status bar at the bottom of the screen
window.status="Switch picture at 5 : "+counter+" PicNumber:
"+PicNumber+" ";
//Display pic in what <IMG> tag roll is what I called the image
document.roll.src = eval("Rollpic" + PicNumber);
//function calls itself
CallSwitchPic=window.setTimeout("SwitchPic("+counter+")",1500);
}
else{
//if its not the last picture goto the next picture
if(PicNumber < NumberOfPictures){
PicNumber++;
SwitchPic(0);
}
//its the last picture go to the first one
else{
PicNumber=1;
SwitchPic(0);
}
}
}
// Stop hiding from old browsers -->
</script>
</HEAD>
<BODY onLoad="SwitchPic(0)">
<img src="1.jpg" border="0" name="roll">
</BODY>
</HTML>