Different to: Restart an animated GIF from JavaScript without reloading the image
I have a simple animated gif icon which plays once (it does not repeat loop)
I have it inside a DIV. When the user mouse the mouse over the DIV I want to play the GIF. When they move out the DIV turns off. When the move back I want them to play the GIF again - can I use a force cache on jQuery:
HTML:
<div class="datebox magicbox_1" id="date_1">
<img id="magicimage_1" class="magicimg" src="assets/img/dates/gifpicture.gif" alt=""/>
</div>
jQuery:
$("#date_1").hover(function () {
$("#magicimage_1").show();
}, function () {
$("#magicimage_1").hide();
});
// thought about these
/*
var myImg = new Image();
myImg.src = "image.gif?rnd=" + Math.random();
img src="filename.gif?rand=<#?=rand(1,1000);?>" alt=""
*/