Have this markup for products in category page of my online store...
Product A
<div id="lateral-thumbnails" class="product-col-left">
<a class="fancybox lateral-gallery" onMouseOver="return showPic(this);">
<img src="/images/001.jpg" alt="" />
</a>
<a class="fancybox lateral-gallery" onMouseOver="return showPic(this);">
<img src="/images/002.jpg" alt="" />
</a>
...
</div>
<div id="product-img-box" class="product-img-box">
<a id="mainframeimage-AAA" href="AAA url">
<img src="/images/AAA.jpg" alt="" />
</a>
</div>
Product B
<div id="lateral-thumbnails" class="product-col-left">
<a class="fancybox lateral-gallery" onMouseOver="return showPic(this);">
<img src="/images/901.jpg" alt="" />
</a>
<a class="fancybox lateral-gallery" onMouseOver="return showPic(this);">
<img src="/images/902.jpg" alt="" />
</a>
...
</div>
<div id="product-img-box" class="product-img-box">
<a id="mainframeimage-BBB" href="BBB url">
<img src="/images/BBB.jpg" alt="" />
</a>
</div>
<script type="text/javascript">
function showPic (thumbs) {
if (document.getElementById) {
jQuery('#mainframeimage<?php echo $_product->getId();?>').fadeOut(250);
setTimeout(function() {
document.getElementById('mainframeimage<?php echo $_product->getId();?>').src = thumbs.href;
jQuery('#mainframeimage<?php echo $_product->getId();?>').fadeIn(250);
}, 250);
return false;
} else {
return true;
}
}
</script>
With this javascript code i can change thumbs src's with fade effect to LAST mainframeimage ID processed.
How can i say in javascript language that images 001.jpg and 002.jpg will be placed in mainframeimage-AAA and images 901.jpg and 902.jpg in mainframeimage-BBB?
Regards