mkormendy
11/4/2014 - 3:35 PM

IE 10 11 Feature Detection

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);
      	}
});