Firefox에서 제대로 작동하려면 다음 코드를 얻으려고 조금 힘들었습니다. Chrome에서 정상적으로 작동하지만 파이어 폭스에서는 작동하지 않습니다. 누군가가 기뻐할 수 있다면 도움이 될 것입니다.Firefox에서 CSS 슬라이드 쇼가 작동하지 않습니다.
CSS
.SlidingPhotoFrame{ max-width:100%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; border: 1px solid #bbe3ff; padding:5px; margin-bottom:10px; background-color:white; }
.SlidingPhoto {
padding-top: 50.20%; /* 450px/800px = 0.5625 */
margin:0; text-align:center;
background:url(Slideshow/1.JPG)) center top no-repeat;
background-size: cover;
-moz-background-size: cover; /* Firefox 3.6 */
background-position: center; /* Internet Explorer 7/8 */
animation-name:PhotoFrames;
animation-duration:20s;
animation-timing-function:ease-in-out;
animation-delay:0s;
animation-iteration-count:infinite;
animation-play-state:running;
/* Safari and Chrome: */
-webkit-animation-name:PhotoFrames;
-webkit-animation-duration:20s;
-webkit-animation-timing-function:ease-in-out;
-webkit-animation-delay:0s;
-webkit-animation-iteration-count:infinite;
-webkit-animation-play-state:running;
}
@keyframes PhotoFrames
{
0% {background:url(Slideshow/1.JPG) center top no-repeat; }
23% {background:url(Slideshow/1.JPG) center top no-repeat; }
25% {background:url(Slideshow/2.JPG) center top no-repeat; }
47% {background:url(Slideshow/2.JPG) center top no-repeat; }
50% {background:url(Slideshow/3.JPG) center top no-repeat; }
74% {background:url(Slideshow/3.JPG) center top no-repeat; }
75% {background:url(Slideshow/4.JPG) center top no-repeat; }
97% {background:url(Slideshow/4.JPG) center top no-repeat; }
100% {background:url(Slideshow/1.JPG) center top no-repeat; }
}
@-webkit-keyframes PhotoFrames /* Safari and Chrome */
{
0% {background:url(Slideshow/1.JPG) center top no-repeat; }
23% {background:url(Slideshow/1.JPG) center top no-repeat; }
25% {background:url(Slideshow/2.JPG) center top no-repeat; }
47% {background:url(Slideshow/2.JPG) center top no-repeat; }
50% {background:url(Slideshow/3.JPG) center top no-repeat; }
74% {background:url(Slideshow/3.JPG) center top no-repeat; }
75% {background:url(Slideshow/4.JPG) center top no-repeat; }
97% {background:url(Slideshow/4.JPG) center top no-repeat; }
100% {background:url(Slideshow/1.JPG) center top no-repeat; }
}
** HTML **
<div class="SlidingPhotoFrame">
<figure class="SlidingPhoto"></figure>
</div>
같은 일을 할 수있는 더 좋은 방법, 나는 가능한 한 간단하게 코드를 유지하려면, 제안하십시오이 있다면 , 언제든지 가능할 때. Safari 또는 IE를 아직 확인하지 않았습니다 ... 그 어떤 제안도 좋습니다.
jsfiddle이 도움이 될 것입니다. – bjb568
여기에 '야생'입니다 http://www.poipleshadow.com/ –
'@ -webkit-keyframes'가 표시되지만 '@ -moz-keyframes'가 표시되지 않습니다. :) – drip