- add a separate class= "active" to li every second, and the rest is empty.
- wait a second to pass, the first li is empty, the second li adds class= "active", and so on.
HTML:
<ul id="new">
<li><img src="img/01.jpg" ></li>
<li><img src="img/02.jpg" ></li>
<li><img src="img/03.jpg" ></li>
<li><img src="img/04.jpg" ></li>
<li><img src="img/05.jpg" ></li>
<li><img src="img/06.jpg" ></li>
</ul>
js:
var temp = document.getElementById("new");
var li = temp.getElementsByTagName("li");
setInterval(function(){
for(var i = 0; i<li.length; iPP){
//
li[i].className="active";
//1
},1000);