Skip to content

Instantly share code, notes, and snippets.

@master5o1

master5o1/not-ie.js

Created Apr 22, 2015
Embed
What would you like to do?
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