0

I have a bunch of animated gifs posted on my blog and i would like to add a Play Button over each image to be able to play them when you click over them.

Oscar Batlle
  • 157
  • 2
  • 4
  • 22
  • http://stackoverflow.com/questions/5818003/stop-a-gif-animation-onload-on-mouseover-start-the-activation - you may need an static image to swap out when clicked – ashley Aug 27 '13 at 15:32

1 Answers1

0

You will need two images. One image that is just the first frame with no animation. Then, wire up the click to replace that static image with your animated image.

Something like so:

$(function(){
   $('#StaticImage').click(function(){
      $(this).attr('src', 'animated_file.gif');
   });
 });
Boone
  • 1,046
  • 1
  • 12
  • 30
  • So i manually got to get an static image of every gifs that i have to do this? and how im going to be able to add a Play button just like 9gag does? check out 9gag.com Gifs to see what I'm trying to do here. Thank You! – Oscar Batlle Aug 27 '13 at 16:09
  • Yes, it is two images. Your static image will have to have a transparent play button on it. – Boone Aug 27 '13 at 16:14