S
scorpion53061
I was really proud of myself. Having never worked with javascript before I
took two scripts - one that did a slideshow but fit the image to the table
and one that did not but provided a caption and I managed to get them
together.
Unfortauntely the "Previous" link returns an "undefined" error the second
time through it. Does anyone have an idea what I might have done wrong??
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<script>
var NewImg = new Array(); // don't change this
var Caption = new Array(); // don't change this
NewImg[7] = 'pic1.jpeg';
NewImg[2] = 'pic2.jpeg';
NewImg[3] = 'pic3.jpeg';
NewImg[4] = 'pic4.jpeg';
NewImg[5] = 'pic5.jpeg';
NewImg[6] = 'pic6.jpeg';
NewImg[1] = 'pic7.jpeg';
NewImg[8] = 'newlogo.jpg';
// Specify the Captions...
// To add more captions, just continue
// the pattern, adding to the array below.
// To use fewer captions, remove lines
// starting at the end of the Caption array.
// Caution: The number of Captions *must*
// equal the number of NewImgs!
Caption[1] = "Text for picture1.";
Caption[2] = "Text for picture2.";
Caption[3] = "Text for picture3.";
Caption[4] = "Text for picture4.";
Caption[5] = "Text for picture5.";
Caption[6] = "Text for picture6.";
Caption[7] = "Text for picture7.";
Caption[8] = "Text for picture8.";
var ImgNum = 0;
var ImgLength = NewImg.length - 1;
var ImgCap = Caption.length - 1;
//Time delay between Slides in milliseconds
var delay = 3000;
var lock = false;
var run;
function chgImg(direction) {
if (document.images) {
ImgNum = ImgNum + direction;
ImgCap = ImgCap + direction;
if (ImgNum > ImgLength) {
ImgNum = 1;
}
if (ImgNum < 0) {
ImgNum = ImgLength;
}
document.slideshow.src = NewImg[ImgNum];
}
if (document.getElementById)
document.getElementById("CaptionBox").innerHTML= Caption[ImgNum];
}
function auto() {
if (lock == true) {
lock = false;
window.clearInterval(run);
}
else if (lock == false) {
lock = true;
run = setInterval("chgImg(1)", delay);
}}
// End -->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<body onload='showHot=true;self.focus();'">
<table border="1" id="table1 " width="30%">
<tr>
<td id=CaptionBox class=Caption align=center colspan="3">
Welcome to Sand Bay Beach Resorts!!<br>Designed By
<a href="http://www.kjmsolutions.com ">KJM Solutions</a></td>
</td>
</tr>
<td colspan="3"><!--webbot bot="HTMLMarkup " startspan --><img
src="http://newlogo.jpg " name="slideshow"> //this line causes error on
slideshow but //putting a space after the w and before the " seemed to make
it go away. I know dumb idea right ?
<tr/>
<td width="50 "><a href="javascript:chgImg(1) ">Next</a></td>
<td width = "50 "><a href="javascript:chgImg(-1) ">Previous</a></td>
<td width = "50 "><a href="javascript:auto() ">Auto/Stop</a></td>
</tr>
</table>
<!--webbot bot="HTMLMarkup " endspan i-checksum="26346" --></td>
</tr>
</table>
<p> </p>
</body>
</html>
took two scripts - one that did a slideshow but fit the image to the table
and one that did not but provided a caption and I managed to get them
together.
Unfortauntely the "Previous" link returns an "undefined" error the second
time through it. Does anyone have an idea what I might have done wrong??
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<script>
var NewImg = new Array(); // don't change this
var Caption = new Array(); // don't change this
NewImg[7] = 'pic1.jpeg';
NewImg[2] = 'pic2.jpeg';
NewImg[3] = 'pic3.jpeg';
NewImg[4] = 'pic4.jpeg';
NewImg[5] = 'pic5.jpeg';
NewImg[6] = 'pic6.jpeg';
NewImg[1] = 'pic7.jpeg';
NewImg[8] = 'newlogo.jpg';
// Specify the Captions...
// To add more captions, just continue
// the pattern, adding to the array below.
// To use fewer captions, remove lines
// starting at the end of the Caption array.
// Caution: The number of Captions *must*
// equal the number of NewImgs!
Caption[1] = "Text for picture1.";
Caption[2] = "Text for picture2.";
Caption[3] = "Text for picture3.";
Caption[4] = "Text for picture4.";
Caption[5] = "Text for picture5.";
Caption[6] = "Text for picture6.";
Caption[7] = "Text for picture7.";
Caption[8] = "Text for picture8.";
var ImgNum = 0;
var ImgLength = NewImg.length - 1;
var ImgCap = Caption.length - 1;
//Time delay between Slides in milliseconds
var delay = 3000;
var lock = false;
var run;
function chgImg(direction) {
if (document.images) {
ImgNum = ImgNum + direction;
ImgCap = ImgCap + direction;
if (ImgNum > ImgLength) {
ImgNum = 1;
}
if (ImgNum < 0) {
ImgNum = ImgLength;
}
document.slideshow.src = NewImg[ImgNum];
}
if (document.getElementById)
document.getElementById("CaptionBox").innerHTML= Caption[ImgNum];
}
function auto() {
if (lock == true) {
lock = false;
window.clearInterval(run);
}
else if (lock == false) {
lock = true;
run = setInterval("chgImg(1)", delay);
}}
// End -->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<body onload='showHot=true;self.focus();'">
<table border="1" id="table1 " width="30%">
<tr>
<td id=CaptionBox class=Caption align=center colspan="3">
Welcome to Sand Bay Beach Resorts!!<br>Designed By
<a href="http://www.kjmsolutions.com ">KJM Solutions</a></td>
</td>
</tr>
<td colspan="3"><!--webbot bot="HTMLMarkup " startspan --><img
src="http://newlogo.jpg " name="slideshow"> //this line causes error on
slideshow but //putting a space after the w and before the " seemed to make
it go away. I know dumb idea right ?
<tr/>
<td width="50 "><a href="javascript:chgImg(1) ">Next</a></td>
<td width = "50 "><a href="javascript:chgImg(-1) ">Previous</a></td>
<td width = "50 "><a href="javascript:auto() ">Auto/Stop</a></td>
</tr>
</table>
<!--webbot bot="HTMLMarkup " endspan i-checksum="26346" --></td>
</tr>
</table>
<p> </p>
</body>
</html>