Skip to content

Instantly share code, notes, and snippets.

@ischenkodv
Last active December 20, 2015 06:08
Show Gist options
  • Save ischenkodv/6083239 to your computer and use it in GitHub Desktop.
Save ischenkodv/6083239 to your computer and use it in GitHub Desktop.
A function that detects CSS transform availability in browsers.
function getSupportedTransform() {
var prefixes = 'transform WebkitTransform MozTransform OTransform msTransform'.split(' ');
for(var i = 0; i < prefixes.length; i++) {
if(document.createElement('div').style[prefixes[i]] !== undefined) {
return prefixes[i];
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment