Tag : JavaScript

5 years, 10 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);
}