나는 CSS Transition not firing when adding class to body (Firefox)과 비슷한 문제가 있지만, 다른 방법으로 요소를 타겟팅하거나 클래스를 제거하는 방법을 찾을 수 있습니다. 여기 CSS 전환이 파이어 폭스에서 작동하지 않습니다.
내가 무엇을 가지고 :마크 업 :
<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
배경 이미지간에 전환 할 수 없습니다. 그러나 배경 이미지를 스택에 넣고 불투명도를 변경할 수 있습니다. [여기에 애니메이션으로 등록 할 수있는 편리한 목록이 있습니다.] (https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties) – misterManSam