Skip to content

Instantly share code, notes, and snippets.

@lylijincheng
Created August 9, 2013 10:45
Show Gist options
  • Save lylijincheng/6192739 to your computer and use it in GitHub Desktop.
Save lylijincheng/6192739 to your computer and use it in GitHub Desktop.
Prefix vendor for JS.
var vendor = function() {
var vendors, i, len, style;
vendors = ['', 'webkit', 'ms', 'Moz', 'O'];
style = document.createElement('div').style;
len = vendors.length;
for (i = 0; i < len; i += 1) {
if ((vendors[i] + 'Transform') in style) {
return vendors[i];
}
}
return '';
}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment