PDA

View Full Version : Another Question on the Preload Image Script



Shutdown007
08-11-2007, 02:24 PM
1) Script Title: Preload Image (with progress bar) Script

2) Script URL (on DD):http://www.dynamicdrive.com/dynamicindex4/preloadimage.htm

3) Describe problem:No Problem

I was just wondering if there is any way I can make the script stop after pre-loading images and have an enter button to enter the site instead of automatically going into it....

Thanks for all the help

Patrick

jscheuer1
08-11-2007, 02:58 PM
Change the function checkLoad() to:


function checkLoad() {
if (currCount == preImages.length) {
var enterButton=document.all? document.all['ebut'] : document.getElementById('ebut');
enterButton.style.display='visible';
return
}
for (i = 0; i <= preImages.length; i++) {
if (loaded[i] == false && preImages[i].complete) {
loaded[i] = true
eval("document.img" + currCount + ".src=dots[1].src")
currCount++
}
}
timerID = setTimeout("checkLoad()",10)
}

And add this button wherever you like to the body of the page:


<input style="visibility:hidden;" id="ebut" type="button" value="Enter" onclick="window.location.replace(locationAfterPreload);">