Javascript scrolling images

JONNYB

New Member
Hey there,

wondering if I could also for a bit of advice, I'm using a Javascript to scroll images on the homepage of a site i'm working on...

what I ideally want to do it have each image as a h ref linking to a page within the site.

If i try to assign this in the .js file it stops to scrolling function.

Does anyone know a way around this?

below is my javascript.... if anyone can help it'd be greatly appreciated.

var imgs = new Array(); var imgcnt = 0; var thisimg = 0;
imgs[imgcnt++] = 'images/tiarasindex.gif';
imgs[imgcnt++] = 'images/braceletsindex.gif';
imgs[imgcnt++] = 'images/earringsindex.gif';
imgs[imgcnt++] = 'images/necklaceindex.gif';
imgs[imgcnt++] = 'images/vintageindex.gif';
imgs[imgcnt++] = 'images/shoesindex.gif';
imgs[imgcnt++] = 'images/accessoriesindex.gif';
imgs[imgcnt++] = 'images/bridesmaidindex.gif';


function nextImg() {
if (document.images) {
thisimg++;
if (thisimg >= imgcnt) thisimg = 0;
document.rollimg.src = imgs[thisimg];
}
}
function prevImg() {
if (document.images) {
thisimg--;
if (thisimg < 0) thisimg = imgcnt-1;
document.rollimg.src = imgs[thisimg];
}
}
 

DHDdirect

New Member
Are you getting any script errors?

Double check all your paths. Is your .js file in a subfolder or in the root directory?
 

JONNYB

New Member
hey, so the code ifs all right and the whole thing works (i.e. scroll etc) the problem appears to be with the href.

The .js file is saved in the route directory, but again that is working as the scroll is good.

When I'm adding the Href in, it's in the .js file also, do you know if this is meant to be possible?
 
Top