Skip to content

Instantly share code, notes, and snippets.

@mjball
Created November 30, 2010 18:02
Show Gist options
  • Save mjball/722082 to your computer and use it in GitHub Desktop.
Save mjball/722082 to your computer and use it in GitHub Desktop.
Fixes imgur gallery's broken zoom feature in chrome
// ==UserScript==
// @name Fix Imgur Gallery
// @namespace http://mjball.github.com
// @description Fixes imgur gallery's broken zoom feature in chrome - no longer needed!
// @include http://imgur.com/gallery/*
// @include http://www.imgur.com/gallery/*
// ==/UserScript==
// No longer needed!
var styleSheets = document.styleSheets,
i = styleSheets.length,
styleSheet,
rules,
j,
rule;
while (i--)
{
styleSheet = styleSheets[i];
if (styleSheet.href && styleSheet.href.slice(-15) === 'jquery.zoom.css')
{
rules = styleSheet.rules;
j = rules.length;
while (j--)
{
rule = rules[j];
if (rule.selectorText === 'div.jquery-image-zoom img, div.jquery-image-zoom embed, div.jquery-image-zoom object, div.jquery-image-zoom div')
{
rule.style.cssText = '';
break;
}
}
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment