在IE中模仿CSS3转换? [英] Imitate CSS3 transition in IE?

查看:136
本文介绍了在IE中模仿CSS3转换?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用规则的组合实现CSS3 转换规则在跨浏览器兼容的方式尽可能:我使用 transition -webkit-transition -moz-transition -o-transition

I'm using a combination of rules to achieve the CSS3 transition rule in as cross-browser compatible a way as possible: I'm using transition, -webkit-transition, -moz-transition, and -o-transition.

是否有类似的 -ms- transition 属性为任何版本的Internet Explorer?对于IE的旧版本有一个专有的过滤器,类似下面的规则在IE 6-8中的透明度工作?

Is there a similar -ms-transition property for any version of Internet Explorer? Is there a proprietary filter for older versions of IE, similar to how the following rules work for opacity in IE 6-8?

/* IE 8 */ 
-ms-filter: "progid:DXImageTransform.Microsoft. Alpha(Opacity=50)"; 
/* IE 5-7 */ 
filter: alpha(opacity=50);


推荐答案

版本的IE。

我知道接近它的唯一方法是使用JQuery的 fadeIn() fadeOut()方法,它实际上在所有版本的IE中都有效。

The only way that I know of to get anything close to it is to use JQuery's fadeIn() and fadeOut() methods, which do actually work in all versions of IE.

警告,他们仍然落在IE的臭名昭着的差的不透明度处理的犯规。当使用IE6-8时,JQuery的淡入淡出效果会有一些奇怪的毛刺,特别是如果你正在淡入一个包含图形的块。

However, I should caution that they still fall foul of IE's notoriously poor opacity handling. JQuery's fade effects can have some weird glitches when used with IE6-8, especially if you're fading a block which contains graphics.

如果你决定尝试,代码死了简单。只需在标题中包含JQuery,然后:

If you decide to try it, the code is dead simple. Simply include JQuery in your headers, and then:

$('#myelement').fadeIn();

JQuery FadeIn手册页了解详情。

当然,这将是替代任何CSS转换效果;它都是通过Javascript完成的,你可能需要抛弃你的CSS3转换,否则它会与JQuery效果冲突。但是如果你想要它与IE一起工作,那就是你要付出的代价。

Of course, this would be instead of any CSS transition effect; it's all done through Javascript, and you'd probably need to throw away your CSS3 transitions, or it'll clash with the JQuery effects. But if you want it to work with IE, that's the price you'll pay.

正如我说的,注意毛刺。测试它,看看它是怎么样的。

And as I say, watch out for the glitches. Test it, and see how it looks for you.

这是唯一的方法,所以如果你真的需要一个过渡效果在IE,这就是你

It's the only way to do it, so if you really need a transition effect in IE, that's what you'll need to do, but be prepared to accept that it may not look all that good.

其他Javascript库如Mootools或Dojo可能有类似的效果,你也可以尝试,但我想象如果他们有它,他们会遭受同样的问题。

Other Javascript libraries such as Mootools or Dojo may have similar effects which you could also try, but I would imagine if they do have it, they'd suffer from the same issues.

这篇关于在IE中模仿CSS3转换?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆