Skip to content

Instantly share code, notes, and snippets.

@Kcko
Created June 16, 2017 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kcko/5f1bfe023142eda9f8cd9df7198dfd64 to your computer and use it in GitHub Desktop.
Save Kcko/5f1bfe023142eda9f8cd9df7198dfd64 to your computer and use it in GitHub Desktop.
On responsive no hover etc
if ('createTouch' in document)
{
try
{
var ignore = /:hover/;
for (var i=0; i<document.styleSheets.length; i++)
{
var sheet = document.styleSheets[i];
for (var j=sheet.cssRules.length-1; j>=0; j--)
{
var rule = sheet.cssRules[j];
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