Created
December 7, 2017 23:37
-
-
Save marxo/4cdebe9f4b4757075b5ee02586510045 to your computer and use it in GitHub Desktop.
ie11
This file contains 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
// Detect IE and append class to <html> element | |
var UA = navigator.userAgent; | |
var html = document.documentElement; | |
if (UA.indexOf("IEMobile") === -1) { | |
if ((UA.indexOf("rv:11.") !== -1) && (!html.classList.contains('ie11')) && window.navigator.msPointerEnabled) { | |
html.classList.add("ie11"); | |
} else if ((UA.indexOf("MSIE 10.") !== -1) && (!html.classList.contains('ie10')) && window.navigator.msPointerEnabled) { | |
html.classList.add("ie10"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment