1
動態圖像這是我的嘗試:如何使距離爲HTML5
CSS代碼:
body {
margin: 0;
padding: 0;
}
#slideshow {
position: relative;
overflow: hidden;
height: 100px;
}
#animate-area {
height: 100%;
width: 2538px;
position: absolute;
left: 0;
top: 0;
background-image: url('http://s10.postimg.org/noxw294zd/banner.png');
animation: animatedBackground 40s linear infinite;
-ms-animation: animatedBackground 40s linear infinite;
-moz-animation: animatedBackground 40s linear infinite;
-webkit-animation: animatedBackground 40s linear infinite;
}
/* Put your css in here */
@keyframes animatedBackground {
from { left: 0; }
to { left: -1269px; }
}
@-webkit-keyframes animatedBackground {
from { left: 0; }
to { left: -1269px; }
}
@-moz-keyframes animatedBackground {
from { left: 0; }
to { left: -1269px; }
}
現在我需要什麼,每一次旋轉完成,然後再開始從右側移動剩下。每完成一次旋轉我都需要一段距離。
有人可以幫助解決這個問題嗎?
在此先感謝。
http://jsfiddle.net/6d6xa65n/4/
這是你在找什麼? http://jsfiddle.net/6d6xa65n/4/(我縮短了動畫的時間,以便更快地看到碰撞是什麼)。 – 2014-08-30 12:12:03
不,我不認爲我明白你的意思是「距離」也許這個:http://jsfiddle.net/webtiki/6d6xa65n/5/? – 2014-08-30 12:18:14
仍然我困惑,當background-image:url('http://s10.postimg.org/noxw294zd/banner.png');當background-image:url('../ img/banner.png');有不同的東西,那就是下一次輪換再從左邊開始。 – sasi 2014-08-30 12:30:15