How to prevent GIF images from uploading and only authorize them by clicking a button?

Asked

Viewed 127 times

1

Self-explanatory title "How to prevent the loading of GIF images and only authorize it by clicking a button?".

  • http://embed.ly/docs/tutorials/gif

  • In that LINK there is a similar question, can serve as reference.

1 answer

3

You can use the freezeframe for such, the other way to do is to have a static image of the animated gif, and via jQuery make the exchange of images.

It would look like this using two images:

Jquery

$(function(){
   $("img").click(function(){
      var gif = $(this).data('animate');
      $(this).attr('src', gif);
   });
});

HTML

<img src="/static/88855445.jpg" data-animate="/gif/88855445.gif" alt="" />

By clicking on the image it will "start" the GIF

Browser other questions tagged

You are not signed in. Login or sign up in order to post.