(Can't believe that I got a response. =D)
It is returning a result, but my problem relies with preloading -this- part of the function:
- else if(this.preloaderLoading)
-
{
-
var preloaderProgressBar;
-
this.preloaderProgressBar = new Image();
-
this.preloaderProgressBar.src = "./images/bar.png";
-
document.preloaderProgressBar = new Image();
-
document.preloaderProgressBar.src = this.preloaderProgressBar;
-
var preloaderLeft;
-
this.preloaderLeft = new Image();
-
this.preloaderLeft.src = "./images/left.png";
-
document.preloaderLeft = new Image();
-
document.preloaderLeft.src = this.preloaderLeft;
-
var preloaderRight;
-
this.preloaderRight = new Image();
-
this.preloaderRight.src = "./images/right.png";
-
document.preloaderRight = new Image();
-
document.preloaderRight.src = this.preloaderRight;
-
var preloaderTop;
-
this.preloaderTop = new Image();
-
this.preloaderTop.src = "./images/top.png";
-
document.preloaderTop = new Image();
-
document.preloaderTop.src = this.preloaderTop;
-
var preloaderBottom;
-
this.preloaderBottom = new Image();
-
this.preloaderBottom.src = "./images/bottom.png";
-
document.preloaderBottom = new Image();
-
document.preloaderBottom.src = this.preloaderBottom;
-
var preloaderLoaded;
-
this.preloaderLoaded = new Image();
-
this.preloaderLoaded.src = "./images/loaded.png";
-
document.preloaderLoaded = new Image();
-
document.preloaderLoaded.src = this.preloaderLoaded;
-
var preloaderUnLoaded;
-
this.preloaderUnLoaded = new Image();
-
this.preloaderUnLoaded.src = "./images/unloaded.png";
-
document.preloaderUnLoaded = new Image();
-
document.preloaderUnLoaded.src = this.preloaderUnLoaded;
-
imagePreloader(false, this.id, false, false);
-
}
-
else
-
{
-
if(document.preloaderProgressBar.readyState
-
&& document.preloaderLeft.readyState
-
&& document.preloaderRight.readyState
-
&& document.preloaderTop.readyState
-
&& document.preloaderBottom.readyState
-
&& document.preloaderLoaded.readyState
-
&& document.preloaderUnLoaded.readyState)
-
{
-
imagePreloader(true, this.id, false, false);
-
}
-
else
-
{
-
setTimeout("imagePreloader(false, "+this.id+", false, false);", 25);
-
}
If you notice where it says readyState, I tried that instead of complete, but the thing is...
<body onload="initialize();"> calls the initialize function.
The initialize function calls the imagePreloader function:
imagePreloader(false, window.currentImageId, false, true);
The last true at the end makes this.preloaderLoading = true.
Which then sends it into that first part...
Then it calls itself again:
imagePreloader(false, this.id, false, false);
And since all conditions are false in the "if" statement, it goes to the last else.
The last else has an "if" statement in itself.
The if statement checks if all of the images preloaded it the else if statement in the first part of this code on this post... but the problem is... it gets stuck there, if someone could rework this code so that the:
-
if(document.preloaderProgressBar.readyState
-
&& document.preloaderLeft.readyState
-
&& document.preloaderRight.readyState
-
&& document.preloaderTop.readyState
-
&& document.preloaderBottom.readyState
-
&& document.preloaderLoaded.readyState
-
&& document.preloaderUnLoaded.readyState)
returns true... that would be one more step towards finishing this...
...because that's -where- it's stopping, not in the first part of imagePreloaded if statement, because that is skipped entirely.
BTW I added line numbers to the right of the code viewer on my site... if that helps some...