D
David
Hi everyone,
I am trying to stop an image preload sequence by the click of a mouse but
have been unsuccessful trying several methods. Imagine this simple script
below that loads 50 images to cache. If the stopPreload() function is
activated and the ret val set to false, the preload() function still
continues to the end.
Any suggestions on how to stop the preload() function in its process, what
conditions are necessary?
var ret=true;
function preload(){
var k=1;
do {
theImageSrc="image"+k+".jpg";
document.imgArry[k]=new Image;
document.imgArry[k].src=theImageSrc;
k++;
}
while (ret==true && k < 50)
}
}
function stopPreload(){
ret=false;
}
Thanks, David
I am trying to stop an image preload sequence by the click of a mouse but
have been unsuccessful trying several methods. Imagine this simple script
below that loads 50 images to cache. If the stopPreload() function is
activated and the ret val set to false, the preload() function still
continues to the end.
Any suggestions on how to stop the preload() function in its process, what
conditions are necessary?
var ret=true;
function preload(){
var k=1;
do {
theImageSrc="image"+k+".jpg";
document.imgArry[k]=new Image;
document.imgArry[k].src=theImageSrc;
k++;
}
while (ret==true && k < 50)
}
}
function stopPreload(){
ret=false;
}
Thanks, David