Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Kotaku GIF Display Toggle
- // @namespace http://your.homepage/
- // @version 0.1
- // @description Add togglelink to GIFs
- // @author You
- // @include https://www.kotaku.com.au/20*
- // @include http://www.kotaku.com.au/20*
- // @grant none
- // ==/UserScript==
- $('div.media_wrap.image.xlarge>a>img[src$=".gif"]').each(
- function(i, el) {
- var id = 'random-element-id-'+i;
- var img_div = $(el).parent('a').parent('div').attr('id', id);
- img_div.before(
- $('<div>').html(
- $('<a>Toggle GIF</a>').click(function() {
- $('#'+id).toggle();
- })
- )
- );
- img_div.hide();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement