console
var oul=$("zd").getElementsByTagName("ul")[0],
oli=oul.getElementsByTagName("li"),
timers=null,
timer=null,
i=0,
oliW=oli[0].offsetWidth;
oul.style.width=oli.length*oliW+"px";
function $(id){
return document.getElementById(id);
}
function getClass(obj,name){
if(obj.currentStyle){
return obj.currentStyle[name]
}else{
return getComputedStyle(obj,false)[name]
}
}
function Stratmove(obj,json,funEnd,callback){
clearInterval(obj.timer);
obj.timer=setInterval(function(){
for(var attr in json){
var bStop=true,
cuur=parseFloat(getClass(obj,attr)),
speed=0;
if(attr=="opacity"){
cuur=Math.round(parseFloat(getClass(obj,attr))*100);
}else{
cuur=parseFloat(getClass(obj,attr));
}
speed=(json[attr]-cuur)/8;
speed=speed>0?Math.ceil(speed):Math.floor(speed);
if(cuur!=json[attr]){
bStop=false;
}
if(attr=="opacity"){
obj.style["opacity"]=(cuur+speed)/100;
obj.style["filter"]="alpha(opacity="+cuur+speed+")";
}else{
obj.style[attr]=Math.round(cuur+speed)+"px";
}
if(bStop){
clearInterval(obj.timer);
callback();
}
if(funEnd)funEnd();
}
},30)
}
var arr=[];
timers=setInterval(function(){
Stratmove(oul,{"left":-oliW},null,calls);
},3000);
function calls(){
arr.push(oli[0]);
oul.removeChild(oli[0]);
oul.appendChild(arr[0]);
arr.splice(0,arr.length);
oul.style.left=0;
}
<div id="zd">
<ul>
<li > <img src="http://img.yzcdn.cn/upload_files/2015/08/06/FpSll7_ng3DmE7JfZT-YsQozxXB1.jpg%21730x0.jpg" style="width:100%; height:100%"/></li>
<li > <img src="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2213111953,2032525380&fm=23&gp=0.jpg" style="width:100%; height:100%"></li>
<li > <img src ="http://static.runoob.com/images/demo/demo2.jpg" style="width:100%; height:100%"></li>
</ul>
</div>
#zd{
margin:0;
padding:0;
width: 600px;
height: 200px;
overflow: hidden;
position: relative;
margin:0 auto;
}
ul{
position: absolute;
left:0;
top:0;
}
li{
width: 600px;
height: 300px;
float: left;
}
.current {
float: left;
padding:2px;
}
h1{
text-align:center;
}