Skip to content

Instantly share code, notes, and snippets.

@jason-s13r
Created April 22, 2015 05:19
Show Gist options
  • Save jason-s13r/23dc705d3a181f532484 to your computer and use it in GitHub Desktop.
Save jason-s13r/23dc705d3a181f532484 to your computer and use it in GitHub Desktop.
Small is or is not internet explorer. Provides .ie or .is-ie and .not-ie css classes.
(function(n, o, t, i, e){
n.isIE = t;
if (t) {
o.styleSheets[0].addRule('.ie, .is-ie', 'display: initial');
o.styleSheets[0].addRule('.not-ie', 'display: none');
return;
}
i = o.createElement('style');
i.innerHTML = '.ie,.is-ie { display: none; } .not-ie: { display: initial; }'
e = document.getElementsByTagName('script')[0];
e.parentNode.insertBefore(i, e);
})(window, document, /*@cc_on!@*/false || !!document.documentMode);
(function(d,a,e,b,c){(d.isIE=e)?(a.styleSheets[0].addRule(".ie, .is-ie","display: initial"),a.styleSheets[0].addRule(".not-ie","display: none")):(b=a.createElement("style"),b.innerHTML=".ie,.is-ie { display: none; } .not-ie: { display: initial; }",c=document.getElementsByTagName("script")[0],c.parentNode.insertBefore(b,c))})(window,document,!!document.documentMode);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment