I am having trouble getting thumbnail images to swap with the main image.
It’s a bit complicated as its embeded in asp, but I dont have an error, just the images arent swapping.
Here is an example:
And the code in full:
<script type="text/javascript">
/*<=!=[=C=D=A=T=A=[*/
function Swap(obj,id){
var main=document.getElementById(id).getElementsByTagName('IMG')[0],msrc=main.src,obj=obj.getElementsByTagName('IMG')[0],tsrc=obj.src;
main.src=tsrc;
obj.src=msrc;
return false;
}
/*]=]=>*/
</script>
wr "<div class='ClockImg'>" & vbcrlf
wr "<table style='position:relative; width:100%; text-align:right'><tr><td>" & vbcrlf
wr "<div id='imgHolder'>" & vbcrlf
wr "<img src='/products/" & arr(0,i) & "/" & image & ".jpg' alt='" & arr(14,i) & "'/>" & vbcrlf
wr "</div>" & vbcrlf
wr "</td><td id='thumbz'>" & vbcrlf
For j = 1 To 6
Select Case j
Case 1 : filename = "a"
Case 2 : filename = "b"
Case 3 : filename = "c"
Case 4 : filename = "d"
Case 5 : filename = "e"
Case 6 : filename = "f"
End Select
If fs.FileExists(Server.MapPath(".") & "\\products\\" & pid & "\\" & filename & ".jpg")=true then
wr "<a href='#' class='showImg active' onmouseup=""<script>return Swap(this,'imgHolder');</script>""><img class='HomeFeaturedImages3' src='/products/" & arr(0,i) & "/" & filename & ".jpg' width='75' alt='" & Server.HtmlEncode(arr(13+j,i)) & "' /></a>" & vbcrlf
End If
wr "</tr></table>" & vbcrlf
wr "</div>" & vbcrlf
There no errors on the page, just the images wont swap.