In general, I want the pictures to slowly disappear one by one and emerge, but here’s the problem due to the TimeOut cycle. Help make this code work?
function timeStart() { var array_one = new Array("#bmw1", "#bmw2", "#bmw3", "#bmw4", "#bmw5"); var array_two = new Array("#mercedes1", "#mercedes2", "#mercedes3", "#mercedes4", "#mercedes5") for (var a = 0, z = 1, b = 1000; a < 5; ++a, b += 2000, ++z) { setTimeout(zes(a, z), 1000) } function zes(one_value, two_value) { $(array_one[one_value] + "," + array_two[one_value]).fadeOut(1000) $(array_one[two_value] + "," + array_two[two_value]).fadeIn(1000) } }