169
rated 0 times
[
171]
[
2]
/ answers: 1 / hits: 28528
/ 12 Years ago, fri, august 17, 2012, 12:00:00
I currently have the following code that replaces a big image when a thumbnail is clicked:
Javascript:
img1 = new Image();
img1.src = '{$smarty.const.dir_images}/l_{$this_page.image1}';
img2 = new Image();
img2.src = '{$smarty.const.dir_images}/l_{$this_page.image2}';
Thumbnail HTML:
<a href=javascript:document['mainimage'].src = img1.src; javascript:void(0);><img src={$smarty.const.dir_images}/t_{$this_page.image1} title= alt=/></a>
<a href=javascript:document['mainimage'].src = img2.src; javascript:void(0);><img src={$smarty.const.dir_images}/t_{$this_page.image2} title= alt=/></a>
Large Image HTML:
<img id=mainimage name=mainimage src={$smarty.const.dir_images}/l_{$this_page.image1} title={$this_page.image1text} alt={$this_page.image1text} />
What I want to do is not only change the large image source when the thumbnail is clicked but the alt & title tags as well.
Thanks in advance
More From » html