Last active
August 29, 2015 14:08
-
-
Save mkormendy/41f0d5298f2eaaa53a8d to your computer and use it in GitHub Desktop.
IE 10 11 Feature Detection
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
// modified from Tim Pietrusky: http://jsfiddle.net/evildonald/jLuF5/ | |
var ie10PlusStyles = [ | |
'msTouchAction', | |
'msWrapFlow', | |
'msWrapMargin', | |
'msWrapThrough', | |
'msOverflowStyle', | |
'msScrollChaining', | |
'msScrollLimit', | |
'msScrollLimitXMin', | |
'msScrollLimitYMin', | |
'msScrollLimitXMax', | |
'msScrollLimitYMax', | |
'msScrollRails', | |
'msScrollSnapPointsX', | |
'msScrollSnapPointsY', | |
'msScrollSnapType', | |
'msScrollSnapX', | |
'msScrollSnapY', | |
'msScrollTranslation', | |
'msFlexbox', | |
'msFlex', | |
'msFlexOrder', | |
'msTextCombineHorizontal']; | |
var property; | |
for (var i = 0; i < ie10PlusStyles.length; i++) { | |
property = ie10PlusStyles[i]; | |
} | |
document.addEventListener("DOMContentLoaded", function(event) { | |
if (document.body.style[property] != undefined) { | |
document.documentElement.className += ' ie nodxfx'; | |
} | |
else if (navigator.appVersion.indexOf("MSIE 9")==1) { | |
// example of usage | |
document.querySelector(".fx").filters.item("DXImageTransform.Microsoft.Light").addAmbient(255, 0, 0, 100); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment