joshwhatk
10/11/2017 - 8:41 PM

Detect IE Version and add it to html as `ie{version}` class

/*
|--------------------------------------------------------------------------
| Simply Check for IE (this will not include Edge)
|--------------------------------------------------------------------------
*/

function IECheck() {
  if(/*@cc_on!@*/false || !!document.documentMode) {
    document.getElementsByTagName('html')[0].classList.add('is-IE');
  }
}
/*
* Inspired by this codepen:
* https://codepen.io/gapcode/pen/vEJNZN
*/
!function(){"use strict";function n(){var n=window.navigator.userAgent,e=n.indexOf("MSIE ");if(e>0)return parseInt(n.substring(e+5,n.indexOf(".",e)),10);var r=n.indexOf("Trident/");if(r>0){var t=n.indexOf("rv:");return parseInt(n.substring(t+3,n.indexOf(".",t)),10)}var i=n.indexOf("Edge/");return i>0?parseInt(n.substring(i+5,n.indexOf(".",i)),10):!1}var e=n();e!==!1&&document.getElementsByTagName("html")[0].classList.add("ie"+e)}();