Gibberish
04-17-2005, 11:38 PM
Anyone know how to do this?
How can I grab the image name "cat05_",add the proper ID to it, then swap the image? I cannot hardcode the name into an array as the page is dynamic so the image name changes on what page the user is on.
What I want it to do is load the image by the number that was pressed. onLoad would be cat05_1. So if number 2 was pressed cat05_2 would be pressed, cat05_3 would load if 3 was pressed.
I am thinkin javascript is the best way to accomplish this.
<tr><td><IMG src="images/cat05_1.jpg" border="0"></td></tr>
<tr>
<td height="20" align="center">
<a href="" class="orangeHL"> 1 </a>
<a href="" class="orangeHL"> 2 </a>
<a href="" class="orangeHL"> 3 </a>
<a href="" class="orangeHL"> 4 </a>
</td>
</tr>
my image folder would be comething like this
cat05_1.jpg
cat05_2.jpg
cat05_3.jpg
cat05_4.jpg
asi02_1.jpg
asi02_2.jpg
asi02_3.jpg
asi02_4.jpg
etc...
How can I grab the image name "cat05_",add the proper ID to it, then swap the image? I cannot hardcode the name into an array as the page is dynamic so the image name changes on what page the user is on.
What I want it to do is load the image by the number that was pressed. onLoad would be cat05_1. So if number 2 was pressed cat05_2 would be pressed, cat05_3 would load if 3 was pressed.
I am thinkin javascript is the best way to accomplish this.
<tr><td><IMG src="images/cat05_1.jpg" border="0"></td></tr>
<tr>
<td height="20" align="center">
<a href="" class="orangeHL"> 1 </a>
<a href="" class="orangeHL"> 2 </a>
<a href="" class="orangeHL"> 3 </a>
<a href="" class="orangeHL"> 4 </a>
</td>
</tr>
my image folder would be comething like this
cat05_1.jpg
cat05_2.jpg
cat05_3.jpg
cat05_4.jpg
asi02_1.jpg
asi02_2.jpg
asi02_3.jpg
asi02_4.jpg
etc...