Internet Explorer – animated GIF stops animation on page unload
10 months, 2 weeks ago
0
Posted in: Programování
When unloading a page with animated GIF, this image stops its animation in the moment of sending new redirect request. Luckily there is a workaround.
function refreshAnimatedImage() {
var image = document.getElementById('animated-image-id');
image.src = image.src;
}
window.onbeforeunload = function() {
window.setTimeout(refreshAnimatedImage, 1);
}
Tags: GIF, IE, JavaScript, onbeforeunload
This entry was posted on Pondělí, Červenec 4th, 2011 at 13.56
You can follow any responses to this entry through the RSS 2.0 feed.