Guest User

Script for GIFs

a guest
Nov 21st, 2017
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. $('document').ready(function () {
  2. var animateGif = function () {
  3. if ($(this).children('img.post-image').attr('src') != '/static/spoiler.png')
  4. $(this).children('img.post-image').attr('src', $(this).attr('href'));
  5. }
  6.  
  7. $('div.file').children('a[href*=".gif"]').each(animateGif);
  8. $(document).on('new_post', function (e, post) {
  9. $(post).find('div.file').children('a[href*=".gif"]').each(animateGif);
  10. });
  11. });
Add Comment
Please, Sign In to add comment