Hi guys
I've been using this, my favorite slideshow script for its simplicity. Now I'd like to add a text caption to each image that rotates in-kind, but I'm having trouble working out the dynamics.
Here's the current script:
<SCRIPT LANGUAGE="JAVAS CRIPT" TYPE="TEXT/JAVASCRIPT">
<!--
myPix = new Array(
"images/picture01.jpg",
"images/picture02.jpg",
"images/picture03.jpg",
"images/picture04.jpg")
thisPic = 0
imgCt = myPix.length - 1
function chgSlide(direct ion) {
if (document.image s) {
thisPic = thisPic + direction
if (thisPic > imgCt) {
thisPic = 0
}
if (thisPic < 0) {
thisPic = imgCt
}
document.myPict ure.src=myPix[thisPic]
}
}
// -->
</SCRIPT>
<P><IMG SRC="images/picture01.jpg" NAME="myPicture " WIDTH="300" HEIGHT="200"></P>
<A HREF="javascrip t:chgSlide(-1)"><< Back</A> <A HREF="javascrip t:chgSlide(1)"> Forward >></A>
I was thinking that I could add this second array, but am stuck on how to integrate the resulting variable into the body:
myCap = new Array(
"Text Caption 01",
"Text Caption 02",
"Text Caption 03",
"Text Caption 04")
thisCap = 0
imgCt = myCap.length - 1
function chgSlide(direct ion) {
if (document.image s) {
thisCap = thisCap + direction
if (thisCap > imgCt) {
thisCap = 0
}
if (thisCap < 0) {
thisCap = imgCt
}
document.myCapt ion.src=myCap[thisCap]
}
}
Any ideas?
I've been using this, my favorite slideshow script for its simplicity. Now I'd like to add a text caption to each image that rotates in-kind, but I'm having trouble working out the dynamics.
Here's the current script:
<SCRIPT LANGUAGE="JAVAS CRIPT" TYPE="TEXT/JAVASCRIPT">
<!--
myPix = new Array(
"images/picture01.jpg",
"images/picture02.jpg",
"images/picture03.jpg",
"images/picture04.jpg")
thisPic = 0
imgCt = myPix.length - 1
function chgSlide(direct ion) {
if (document.image s) {
thisPic = thisPic + direction
if (thisPic > imgCt) {
thisPic = 0
}
if (thisPic < 0) {
thisPic = imgCt
}
document.myPict ure.src=myPix[thisPic]
}
}
// -->
</SCRIPT>
<P><IMG SRC="images/picture01.jpg" NAME="myPicture " WIDTH="300" HEIGHT="200"></P>
<A HREF="javascrip t:chgSlide(-1)"><< Back</A> <A HREF="javascrip t:chgSlide(1)"> Forward >></A>
I was thinking that I could add this second array, but am stuck on how to integrate the resulting variable into the body:
myCap = new Array(
"Text Caption 01",
"Text Caption 02",
"Text Caption 03",
"Text Caption 04")
thisCap = 0
imgCt = myCap.length - 1
function chgSlide(direct ion) {
if (document.image s) {
thisCap = thisCap + direction
if (thisCap > imgCt) {
thisCap = 0
}
if (thisCap < 0) {
thisCap = imgCt
}
document.myCapt ion.src=myCap[thisCap]
}
}
Any ideas?
Comment