简体   繁体   English

CSS3 动画在 IE 或 Opera 中不起作用

[英]CSS3 animations not working in IE or Opera

I created a simple animation to spin an image on a website using webkit properties and CSS3.我创建了一个简单的 animation 来使用 webkit 属性和 CSS3 在网站上旋转图像。

Here the style css (it applys only to divs)这里的样式 css(它只适用于 div)

.bg {
    position: relative;
    top: 0px;
    left: 0px;
    display:block;
    -webkit-animation: spin 100s infinite linear;
    -moz-animation: spin 100s infinite linear;
    -o-animation: spin 100s infinite linear;
    -ms-animation: spin 100s infinite linear;
    opacity:0.8;
    filter:alpha(opacity=80); /* For IE8 and earlier */
    z-index:-1;
}
@-webkit-keyframes spin {
    0% { -webkit-transform: rotate(0deg);}
  100% { -webkit-transform: rotate(360deg);}
}
@-moz-keyframes spin {
    0% { -moz-transform: rotate(0deg);}
  100% { -moz-transform: rotate(360deg);}
}
@-o-keyframes spin {
    0% { -o-transform: rotate(0deg);}
  100% { -o-transform: rotate(360deg);}
}
@-ms-keyframes spin {
    0% { -ms-transform: rotate(0deg);}
  100% { -ms-transform: rotate(360deg);}
}

Now the result is that on Mozilla Firefox, Chrome and Safari, it works without problems, but in Opera and Inte.net explorer I can't see any animation.现在的结果是,在 Mozilla Firefox、Chrome 和 Safari 上,它可以正常工作,但在 Opera 和 Inte.net 资源管理器中,我看不到任何 animation。

http://caniuse.com/#feat=css-animation http://caniuse.com/#feat=css-动画

IE10 and Opera 12 support CSS animations. IE10 和 Opera 12 支持 CSS 个动画。 Not earlier.不早了。

Maybe this information will be usefull for some one who have problems with animations in Opera 12.也许这些信息对一些在 Opera 12 中遇到动画问题的人有用。

In opera 12.x css animation property 'infinite' didn't works for me.在歌剧 12.x css animation 属性“无限”对我不起作用。 Animation was palyed only once and then stoped. Animation 只播放了一次就停止了。 But after I changed integer value of duration (for example 1s) to fractional value (for example 1.1s) animatione start play infinite.但是在我将 integer 的持续时间值(例如 1s)更改为分数值(例如 1.1s)之后,动画开始无限播放。

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

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