Skip to content

Instantly share code, notes, and snippets.

@kentaromiura
Created July 5, 2014 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kentaromiura/ecde2b2ceb999e325be3 to your computer and use it in GitHub Desktop.
Save kentaromiura/ecde2b2ceb999e325be3 to your computer and use it in GitHub Desktop.
Feature detection for applying a transform
var transform = (function(){
for(var props = ['transform', 'webkitTransform', 'OTransform', 'msTransform', 'MozTransform'], i=0, max=props.length; i<max; i++){
var prop = props[i]
if(prop in document.body.style){
return function(element, transformation){
element.style[prop] = transformation
}
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment