Ok, So I know how to make an animated gif… but, how can I place it so that each time it changes, the user can click on it and the URL it goes to will change based on which image is showing?
I found some javascript that seems like it does it, (sets up arrays for the image files and another for the urls associated) …but it was written for a full html page, and when I piece it into this page, the mouse-over shows the name of the function (in the lower status bar) instead of the url it will go to.
Is there an easier way Im just not thinking of?
Subject: ** Brain Fart ** links for banner ads?
The image-flipping function is being called by a setInterval(), right? The image and the link around it should be static – nothing in any event, the image having only a name and src (and an alt if you can manage it) and the link just an id and href (and a title, again if you can manage it). Given that you have an array of image objects and an array of hrefs to correspond, the flipping function should only be doing something like this:
var imageArray = ;
//set up image array
.
.
.
var hrefArray = ;
//set up href array
.
.
.
var imageIndex = 0;
var imageArrayLength = imageArray.length;
function flipImageAndLink() {
//the array index is a global to persist between calls
imageIndex = (++imageIndex < imageArrayLength) ? imageIndex : 0;
document.images[“imageName”].src = imageArray[imageIndex];
document.getElementById(“linkId”).href = hrefArray[imageIndex];
}
Subject: RE: ** Brain Fart ** links for banner ads?
HI STAN!!! Long time no…
Anyway… here is the code, it does not have a setInterval() in it… take a look
![]()
and it does work fine… its just that on mouseover, it doesn’t show the URL name it intends to go to on the status bar (in the browser)
Ruth
Subject: RE: ** Brain Fart ** links for banner ads?
Well, the setTimeout() does more or less what I’d expected the setInterval() to do. The difference between the two is that setTimeout() is a one-shot delay timer, while setInterval() is a repeating event that will continue to call itself until the interval object is cleared. You are doing the same thing by calling banner() from within the banner() function with setTimeout().
The “problem” here is that you are using a JavaScript pseudo-URL to go to the new location. Instead of using the gothere() function, you’ll want to directly modify the href attribute of the link from the banner() function. That will eliminate the need for the gothere() function and make the status bar show the URL instead of the function name. All you need to do is add an ID to the link around the banner ad graphic (I’ll use “bannerLink” in this example) and add one more line to the banner() function:
![]()
Subject: I used to do this with subforms
back before many companies had internet connections, they wanted something like this in their internal databases. I would use a computed subform, that was picked by using a randon number between 1 and the max named subform. The same approach works on the web, where you hve the picture with a link in the subform.
Subject: RE: I used to do this with subforms
Thanks Carl, that sound interesting, now I just have to figure out how to make it change while you are still on the page… a timer I suppose. (or interval, as Stan calls it)