Created
November 28, 2012 03:59
-
-
Save DigiTec/4158953 to your computer and use it in GitHub Desktop.
Quick and optimized poly-fill for transform that has fallbacks for IE 9 and WebKit based browsers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
if (CSSStyleDeclaration.prototype.hasOwnProperty("transform")) { | |
} | |
else if (CSSStyleDeclaration.prototype.hasOwnProperty("msTransform")) { | |
Object.defineProperties(CSSStyleDeclaration.prototype, { | |
transform: { | |
get: function get_transform() { | |
return this.msTransform; | |
}, | |
set: function set_transform(transform) { | |
this.msTransform = transform; | |
} | |
} | |
}); | |
} | |
else { | |
Object.defineProperties(CSSStyleDeclaration.prototype, { | |
transform: { | |
get: function get_transform() { | |
return this.webkitTransform; | |
}, | |
set: function set_transform(transform) { | |
this.webkitTransform = transform; | |
} | |
} | |
}); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment