Animated GIF affected by location.replace

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all...

I have created an aspx page that contains an animated GIF. I am using
javascript and location.replace to redirect from this page to another aspx
page which takes several seconds to load. When location.replace is called the
animated GIFs in the first page stop animating.

Is this standard behaviour? If so, is there an easy work around to prevent
this?

Thanks in advance
 
this is normal for IE - threads are stopped during postback in expection of
an unload.

the most common approach is to use poll the server for status, with a meta
refresh or script, so the gif runs during the delay between polls. if you
pre cache the image and use frames, you sometimes an get the image to run,
but not always.

-- bruce (sqlwork.com)
 
I ran into the same problem way back using classic ASP. As soon as you submit
a page, the animated gif stops doing it's stuff.
The simplest solution is to use client sided javascript to preload the image
and reset the source of the image after you submit the form (or
location.replace):
//preload images when that page loads
var preloadedImg = new Image(32,32);
preloadedImg.src = 'images\img.gif';

//then comes the redirect or form submit or whatever
location.replace;
document.images['imageTag'].src=preloadedImg.src;

...:: daniel last ::..
 
Thanks - this works perfectly.

dainel last said:
I ran into the same problem way back using classic ASP. As soon as you submit
a page, the animated gif stops doing it's stuff.
The simplest solution is to use client sided javascript to preload the image
and reset the source of the image after you submit the form (or
location.replace):
//preload images when that page loads
var preloadedImg = new Image(32,32);
preloadedImg.src = 'images\img.gif';

//then comes the redirect or form submit or whatever
location.replace;
document.images['imageTag'].src=preloadedImg.src;

..:: daniel last ::..


bruce barker said:
this is normal for IE - threads are stopped during postback in expection of
an unload.

the most common approach is to use poll the server for status, with a meta
refresh or script, so the gif runs during the delay between polls. if you
pre cache the image and use frames, you sometimes an get the image to run,
but not always.

-- bruce (sqlwork.com)
 
Back
Top