0
我有一个类似的问题,作为CSS Transition not firing when adding class to body (Firefox)但我似乎找到一种方法来解决它以不同的方式针对元素或删除类。css转换不能在Firefox上工作
以下是我有:
标记:
<div class="ball b40 first">
<a class="ffx-fx" href="javascript:void(0)">
</a>
</div>
CSS:
.ffx-fx {
-webkit-transition: all 1.5s ease-in-out;
-moz-transition: all 1.5s ease-in-out;
-o-transition: all 1.5s ease-in-out;
-ms-transition: all 1.5s ease-in-out;
transition: all 1.5s ease-in-out;
}
.b40 a {
width:220px;
height:220px;
background: url(../images/temp/1_a.jpg) center center;
background-size: 100% 100% !important;
}
.b40 .b40-rotated {
width:220px;
height:220px;
background: url(../images/temp/1_b.jpg) center center !important;
}
个JS:
window.setInterval(function() {
$(".b40 .ffx-fx").toggleClass("b40-rotated");
}, 5000);
所以应该发生什么,转换似乎被设置在一个不同的元素上,而不是你要改变类的元素。它在其他浏览器中工作吗? – adeneo 2014-12-02 23:47:04
您不能在背景图像之间切换。但是,您可以堆叠背景图像并更改不透明度。 [这是可以动画的属性的便利列表。](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties) – misterManSam 2014-12-03 00:22:15