Skip to content

Instantly share code, notes, and snippets.

@larchanka
Last active December 27, 2015 11:19
Show Gist options
  • Save larchanka/7317639 to your computer and use it in GitHub Desktop.
Save larchanka/7317639 to your computer and use it in GitHub Desktop.
Function `browserTransform` detects css-transforms' support in browser and returns css-property, else it returns false.
(function () {
this.browserTransform = function () {
if ('OTransform' in document.body.style)
return '-o-transform';
else if ('webkitTransform' in document.body.style)
return '-webkit-transform';
else if ('mozTransform' in document.body.style)
return '-moz-transform';
else if ('msTransform' in document.body.style)
return '-ms-transform';
else if ('transform' in document.body.style)
return 'transform';
else return false;
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment