Created
September 24, 2014 13:06
-
-
Save weiland/d94584305ac047e6ab42 to your computer and use it in GitHub Desktop.
Get matching browser prefix for css.
This file contains hidden or 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 getBrowserPrefix( propName ) { | |
| var prefixes = ['Moz','Webkit','ms']; // also O and Khtml | |
| for ( var len = prefixes.length; len--; ) { | |
| if( ( prefixes[len] + 'Transform' ) in document.body.style ) { | |
| return '-' + prefixes[len].toLowerCase() + '-' + propName; | |
| } | |
| } | |
| return propName; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment