简体   繁体   English

检测早期版本的ie,即使用less.js,然后使用过滤器?

[英]detect older versions of ie using less.js and then use filter?

I have a function which applies gradients in less as : 我有一个函数,它在以下方面应用渐变:

.linearGradient(@begin: black, @end: white, @switch : 100%) {
  background: @begin;
  background: -webkit-gradient(linear, 0 0, 0 100%, from(@begin), color-stop(@switch, @end));
  background: -moz-linear-gradient(top, @begin, @end @switch);
  background: -o-linear-gradient(top, @begin, @end @switch);
  background: linear-gradient(top, @begin, @end @switch);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=@top, endColorstr=@bottom,GradientType=0 ); /* IE6-9 */
}

I want to be able to test for a versions < IE10 and use filter else just use css3. 我希望能够测试<IE10版本并使用过滤器,否则仅使用css3。

Edit: Additional questions Is there a way to test for browsers? 编辑:其他问题有没有一种方法可以测试浏览器?

Don't bother making a test; 不要打扰测试。 IE10 doesn't support the filter property. IE10不支持filter属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM