Animated GIF affected by location.replace

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
 
B

bruce barker

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)
 
G

Guest

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 ::..
 
G

Guest

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,809
Latest member
moe77

Latest Threads

Top