This is posted at WA as well, I felt a little lonely over there however.
I think I'm close with this, a little push might help. I'm building an image gallery, my images are all located in one folder and their names are cronological from "001.gif" to "00whatever.gif" (all gifs).
The image change is not on timer, it is controlled with a button (i.e. "Show Next Image"). What I'm making is a clever little script that will keep going +1 with image file name (i.e. was 001.gif now 002.gif) 'till it see's there are no files left at which time it will take the visitor to a goodbye page!
This is where I'm up to...
function nextimage() {
//Something here that sees current image
//name and does plus one to the name!
//This then makes the new image a
//variable called "URL"
var tester=new Image(); //Preload
tester.onLoad=isGood; //is it there?
tester.onError=isBad; //no?
tester.src=URL;
}
function isGood() {
//something here to +1 the image name and replace it;
}
function isBad() {
//location.href="goodbye.html";
}
<BODY>
<IMG SRC="001.gif" NAME="picture">
<input type="button" onclick="nextimage();">
Make sense? It sees the current image... adds +1 to the name... sees that this new image is there... if it is... it replaces the current image with the new "+1" image name... if it's not there... it takes the visitor to another page!
Any assistance will be greatly appreciated... Aiden
I think I'm close with this, a little push might help. I'm building an image gallery, my images are all located in one folder and their names are cronological from "001.gif" to "00whatever.gif" (all gifs).
The image change is not on timer, it is controlled with a button (i.e. "Show Next Image"). What I'm making is a clever little script that will keep going +1 with image file name (i.e. was 001.gif now 002.gif) 'till it see's there are no files left at which time it will take the visitor to a goodbye page!
This is where I'm up to...
function nextimage() {
//Something here that sees current image
//name and does plus one to the name!
//This then makes the new image a
//variable called "URL"
var tester=new Image(); //Preload
tester.onLoad=isGood; //is it there?
tester.onError=isBad; //no?
tester.src=URL;
}
function isGood() {
//something here to +1 the image name and replace it;
}
function isBad() {
//location.href="goodbye.html";
}
<BODY>
<IMG SRC="001.gif" NAME="picture">
<input type="button" onclick="nextimage();">
Make sense? It sees the current image... adds +1 to the name... sees that this new image is there... if it is... it replaces the current image with the new "+1" image name... if it's not there... it takes the visitor to another page!
Any assistance will be greatly appreciated... Aiden

Comment