If you just want to show a fixed static image when it is not animating, then it is as simple as changing the image on hover (using CSS or JS).
But if you want to actually freeze the animation in the current frame on the mouse, then the only way to do this is to animate the image manually, for example. with JS:
(function(){ var imgDownload = $('#BtnDownload'), interval = 250; function startAnimation(img, interval, frameCount) { var src, prefix, ext, toId; if (frameCount) img.data('frames', frameCount); interval = interval || img.data('interval'); src = img.attr('src').split('.'); ext = src.pop(); prefix = src.join('.'); img.data('ext') || img.data('ext', ext); img.data('prefix') || img.data('prefix', prefix); restartAnimation(img, interval); img.hover(function() { restartAnimation(img, interval); }); img.mouseout(function() { clearTimeout($(this).data('timeout-id')); }); } function restartAnimation(img, interval) { todId = setTimeout(animate, interval, img); img.data('timeout-id', toId); } function animate(img) { var currentFrame, nextFrame, frameCount, prefix, ext; currentFrame = img.data('current-frame'); frameCount = img.data('frames'); prefix = img.data('prefix'); ext = img.data('ext'); nextFrame = currentFrame + 1; if (nextFrame >= frameCount) nextFrame = 0; img.data('current-frame', nextFrame); img.attr('src', prefix + (nextFrame? nextFrame : '') + '.' + ext); } startAnimation(imgDownload, interval); )());
and the following HTML:
<img src="/img/btn_download.png" alt="Download" data-frames="6">
and these images:
/img/btn_download.png /img/btn_download1.png /img/btn_download2.png /img/btn_download3.png /img/btn_download4.png /img/btn_download5.png
Note: This is a naive implementation. For production code, you want to preload images or just use spritemaps. But the basic concept is the same thing: manually animating the image / button, so when you freeze the animation, it freezes in the current frame. The alternative uses something like jsgif , which uses XHR to load a GIF file, parses binary data to extract individual frames, and then displays using HTML5 Canvas.