正常设置css3样式是这样的
obj.style.WebkitTransition = "all 1s linear";
解析出来的是
<p id="obj" style="transition: all 1s linear;"></p>
我想知道怎么加上-webkit-前缀。如下面
<p id="obj" style="-webkit-transition: all 1s linear;"></p>
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
你有用webpack、gulp、grunt这些工具么- -或者有编辑器吧,弄个Autoprefixer就行了- -
手写很麻烦。。而且可维护性不好,以后突然其中一个前缀不需要了,你又要手动去改
http://stackoverflow.com/ques...
那个,如果你的元素没有内联样式的话,你可以直接obj.style.cssText="-webkit-transition: all 1s linear;...;"试试看
我是会给一个空的 style 标签 ,里面给以个id 然后,