Created
June 23, 2018 03:45
-
-
Save bre7/d8fe2a3b336db06904a076ce890a5bbb to your computer and use it in GitHub Desktop.
Javascript vendor prefixer
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
// Source: Another gist, will update if I can get the link | |
// Replace # with the first letter of the function | |
["#","webkit#","moz#","ms#","o#"].reduce(function(p, v) { return window[v + p] || p; }, "#FUNCTION_NAME"); | |
// E.g. requestAnimationFrame (vendor prefix not needed anymore) | |
["r","webkitR","mozR","msR","oR"].reduce(function(p, v) { return window[v + p] || p; }, "equestAnimationFrame"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment