Last active
December 10, 2015 10:38
-
-
Save paularmstrong/4421903 to your computer and use it in GitHub Desktop.
disable :hover on touch devices
based on https://gist.github.com/4404503 via https://twitter.com/javan/status/284873379062890496 + https://twitter.com/pennig/status/285790598642946048
re http://retrogamecrunch.com/tmp/hover
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (document.hasOwnProperty('createTouch')) { | |
try { | |
var ignore = /:hover/; | |
Array.prototype.slice.call(document.styleSheets).forEach(function (sheet) { | |
Array.prototype.slice.call(sheet.cssRules).forEach(function (rule) { | |
if (rule.type === CSSRule.STYLE_RULE && ignore.test(rule.selectorText)) { | |
sheet.deleteRule(j); | |
} | |
}); | |
}); | |
} | |
catch (e) {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment