on my page, i have thumbs that when clicked, change a main image on the page to the corresponding thumb.
for example,
thumbs (more than just 2):
main image:
javascript:
*thumb code compliments of chris poole*
what i cant figure out is how to have back and next links that will work according to the gallery and not to the pages of my site. i am currently using
but that just loads the last page.
am i making sense? can anyone help?
thanks for your time everyone,
a.
for example,
thumbs (more than just 2):
Code:
<a href="javascript:changePic('aa01.jpg')"><img src="opacity/thumb_aa01.jpg" hsrc="thumb_aa01.jpg" class="thumb" /></a>
<a href="javascript:changePic('aa02.jpg')"><img src="opacity/thumb_aa02.jpg" hsrc="thumb_aa02.jpg" class="thumb" /></a>
main image:
Code:
<img src="images/art/alex/aa01.jpg" name="img" id="img" />
javascript:
Code:
function changePic(source){
document.img.src=source;
}
function init() {
if (!document.getElementById) return
var imgOriginSrc;
var imgTemp = new Array();
var imgarr = document.getElementsByTagName('img');
for (var i = 0; i < imgarr.length; i++) {
if (imgarr[i].getAttribute('hsrc')) {
imgTemp[i] = new Image();
imgTemp[i].src = imgarr[i].getAttribute('hsrc');
imgarr[i].onmouseover = function() {
imgOriginSrc = this.getAttribute('src');
this.setAttribute('src',this.getAttribute('hsrc'))
}
imgarr[i].onmouseout = function() {
this.setAttribute('src',imgOriginSrc)
}
}
}
}
onload=init;
what i cant figure out is how to have back and next links that will work according to the gallery and not to the pages of my site. i am currently using
Code:
<a href="javascript:history.back();">Back</a>
am i making sense? can anyone help?
thanks for your time everyone,
a.