I really like this javascript for an image slideshow. The only thing I woudl
like to do differently is have a cell above the image and navigation that
would allow text content to be placed.
Does anyone have an idea of how that might be acomplished?
Header....
<SCRIPT LANGUAGE="JavaS cript">
<!-- Begin
NewImg = new Array (
"http://pic1.jpeg"
,"http://pic2.jpeg"
,"http://pic3.jpeg"
,"http://pic4.jpeg"
);
var ImgNum = 0;
var ImgLength = NewImg.length - 1;
//Time delay between Slides in milliseconds
var delay = 3000;
var lock = false;
var run;
function chgImg(directio n) {
if (document.image s) {
ImgNum = ImgNum + direction;
if (ImgNum > ImgLength) {
ImgNum = 0;
}
if (ImgNum < 0) {
ImgNum = ImgLength;
}
document.slides how.src = NewImg[ImgNum];
}
}
function auto() {
if (lock == true) {
lock = false;
window.clearInt erval(run);
}
else if (lock == false) {
lock = true;
run = setInterval("ch gImg(1)", delay);
}
}
// End -->
</script>
in body....
<img src="pic1.jpeg" name="slideshow ">
<table>
<tr>
<td align="right">< a href="javascrip t:chgImg(-1)">Previous</a></td>
<td align="center"> <a href="javascrip t:auto()">Auto/Stop</a></td>
<td align="left"><a href="javascrip t:chgImg(1)">Ne xt</a></td>
</tr>
</table>
like to do differently is have a cell above the image and navigation that
would allow text content to be placed.
Does anyone have an idea of how that might be acomplished?
Header....
<SCRIPT LANGUAGE="JavaS cript">
<!-- Begin
NewImg = new Array (
"http://pic1.jpeg"
,"http://pic2.jpeg"
,"http://pic3.jpeg"
,"http://pic4.jpeg"
);
var ImgNum = 0;
var ImgLength = NewImg.length - 1;
//Time delay between Slides in milliseconds
var delay = 3000;
var lock = false;
var run;
function chgImg(directio n) {
if (document.image s) {
ImgNum = ImgNum + direction;
if (ImgNum > ImgLength) {
ImgNum = 0;
}
if (ImgNum < 0) {
ImgNum = ImgLength;
}
document.slides how.src = NewImg[ImgNum];
}
}
function auto() {
if (lock == true) {
lock = false;
window.clearInt erval(run);
}
else if (lock == false) {
lock = true;
run = setInterval("ch gImg(1)", delay);
}
}
// End -->
</script>
in body....
<img src="pic1.jpeg" name="slideshow ">
<table>
<tr>
<td align="right">< a href="javascrip t:chgImg(-1)">Previous</a></td>
<td align="center"> <a href="javascrip t:auto()">Auto/Stop</a></td>
<td align="left"><a href="javascrip t:chgImg(1)">Ne xt</a></td>
</tr>
</table>
Comment