Internet Explorer – animated GIF stops animation on page unload

7 years, 11 months 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);

Napsat komentář

Vaše emailová adresa nebude zveřejněna. Vyžadované informace jsou označeny *