i am displaying a gif image on my wordpress site - when i refresh the page the gif is being cached at the final frame. I would like to make it so everytime the page is refreshed the gif restarts from the beginning. is their any code (php) i could add to the functions.php file in order for this to take place.
Thanks.
Tried a few different options on stack overflow such as:
<img id="gif" src=""/>
<script>document.getElementById('gif').src="path_to_picture.gif?a="+Math.random()</script>
and
var src = 'http://i.imgur.com/JfkmXjG.gif';
$(document).ready(function(){
var $img = $('img');
$('#target').toggle(
function(){
var timeout = 0; // no delay
$img.show();
setTimeout(function() {
$img.attr('src', src);
}, timeout);
},
function(){
$img.hide();
}
);
});