<分区>
我也希望它按顺序改变颜色。该函数应该能够在每个特定的毫秒内更改给定数组中的背景颜色。背景将为蓝色,1 秒后为黄色,1 秒后为粉红色......直到颜色数组结束。
bg_changer(colors_TO_change_In_Sequence , 1000);
var colors_TO_change_In_Sequence = ["blue", "yellow", "pink", "black", "white", "green", "purple", "red", "orange"];
function bg_changer( color_array , millisecond) {
$(body).css("background-color", color_array[i] );
}