Skip to content

Instantly share code, notes, and snippets.

@mkormendy
Last active August 29, 2015 14:08
Show Gist options
  • Save mkormendy/41f0d5298f2eaaa53a8d to your computer and use it in GitHub Desktop.
Save mkormendy/41f0d5298f2eaaa53a8d to your computer and use it in GitHub Desktop.
IE 10 11 Feature Detection
// 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