I'm having a problem with the execution of some code and the timing.
Basically, I want each cell in a table of images to change, followed by a
small delay, so that it creates an animation that wipes across the screen,
rather than changing all at once.
The code I'm using is:
function swapimg(cell,sr c){
document.images[cell].src = src;
}
function fillin(){
for(y=0;y<heigh t;y++){
for(x=0;x<width ;x++){
cellid=x+"x"+y;
imgsrc="blanksq uare.jpg";
setTimeout("swa pimg('"+cell+"' ,'"+imgsrc+'")" ,100);
}
}
}
That should cause there to be a delay, then the image is replace, then the
next iteration of the loop begins, right?
But what actually happens is that the delay still occurs, but the images are
all updated at once, apparently when the script completes execution.
Is there any way to get each image change to display before changing the
next image?
If this is a browser-specific situation, I'm using IE 6 with SP2.
Thanks!
Basically, I want each cell in a table of images to change, followed by a
small delay, so that it creates an animation that wipes across the screen,
rather than changing all at once.
The code I'm using is:
function swapimg(cell,sr c){
document.images[cell].src = src;
}
function fillin(){
for(y=0;y<heigh t;y++){
for(x=0;x<width ;x++){
cellid=x+"x"+y;
imgsrc="blanksq uare.jpg";
setTimeout("swa pimg('"+cell+"' ,'"+imgsrc+'")" ,100);
}
}
}
That should cause there to be a delay, then the image is replace, then the
next iteration of the loop begins, right?
But what actually happens is that the delay still occurs, but the images are
all updated at once, apparently when the script completes execution.
Is there any way to get each image change to display before changing the
next image?
If this is a browser-specific situation, I'm using IE 6 with SP2.
Thanks!
Comment