拿css3 前綴
// JavaScript Document ;(function(w){ w.cssPrefix=(function cssPrefix(){ var vendors = { Webkit: ‘webkit‘, Moz: ‘‘, O: ‘o‘, MS: ‘ms‘ }, prefix = ‘‘, testEl = document.createElement(‘div‘); for(key in vendors){ if (testEl.style[vendors[key] + ‘TransitionProperty‘] !== undefined) { prefix = ‘-‘ + vendors[key].toLowerCase() + ‘-‘; break; } } return prefix; }()); }(window)); //console.log(window.cssPrefix);//-webkit-
时间: 2024-12-26 16:17:25