标签:
function getVendorPrefix() {
  // 使用body是为了避免在还需要传入元素
  var body = document.body || document.documentElement,
    style = body.style,
    vendor = [‘webkit‘, ‘khtml‘, ‘moz‘, ‘ms‘, ‘o‘],
    i = 0;
 
  while (i < vendor.length) {
    // 此处进行判断是否有对应的内核前缀
    if (typeof style[vendor[i] + ‘Transition‘] === ‘string‘) {
      return vendor[i];
    }
    i++;
  }
}
标签:
原文地址:http://www.cnblogs.com/xingweb/p/4286199.html