Switch image by variable?
I'm writing an image gallery script in which the thumbnail for the currently-viewed image is indicated with a smaller image below the thumbnail. My placeholder is as follows:
<img name="indicator0" alt="indicator>
with indicator1, indicator2, etc. following, one below each thumbnail. In my script, which placeholder has the indicator is called by the variable thumbIndicator. I'd like to be able to do that like this:
document.(thumbIndicator).src = "indicator_image.jpg";
but this has not worked. I've also changed my image placeholder to this:
<img id="indicator0" alt="indicator">
and the script to this:
document.getElementByID(thumbIndicator).src = "indicator_image.jpg";
but that hasn't worked either.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread