您可以CSS3做到這一點,是沒有必要的的JavaScript爲:
https://jsfiddle.net/rzcdqh8k/
.animation {
width: 100px;
height: 100px;
background-color: red; //original color
-webkit-animation-name: example;
-webkit-animation-duration: 3s;
-webkit-animation-iteration-count: infinite;
animation-name: example;
animation-duration: 3s;
animation-iteration-count: infinite;
}
/* Chrome, Safari, Opera */
@-webkit-keyframes example {
from {background-color: red;} //original color
to {background-color: white;}
}
/* Standard syntax */
@keyframes example {
from {background-color: red;} //original color
to {background-color: white;}
}
請你想要的動畫序列是用什麼詞形容。從目前的問題來看,這並不完全清楚。另外,由於'taille'沒有被定義,它不會在你的for循環中工作。並且,請顯示'tabRect'是什麼。 – jfriend00
感謝您的支持!動畫應顯示數組中的所有值將被逐一處理(我們正在搜索選擇排序的最大值)。 ** taille **是陣列的大小。 ** tabRect **是一組元素「forme」,定義如下:' 'forme = paper.rect(400,this.y,50,50).attr({fill:color})。animate(animIntroCase (this.x));' 如果不清楚,我很抱歉。請告訴我,如果我應該把所有的代碼。再次感謝你。 –
本網站的工作方式是,您應該使用「編輯」鏈接,並直接向您的問題添加附加說明。人們不應該閱讀評論來理解你的問題。你的問題應該完全清楚。你對你的問題感到低落的原因是它不清楚。 – jfriend00