为了账号安全,请及时绑定邮箱和手机立即绑定

为什么实现不了,求大神指教

请输入问答内容...window.onload=function() { var container=document.getElementById("container"); var list=document.getElementById("list"); var buttons=document.getElementById("buttons").getEelmentByTagName("span"); var prev=document.getElementById("prev"); var next=document.getElementById("next"); var index=1; var len=12; var animated=false; var interval=3000; var timer; function animate(offset){ if(offset==0){ return; } animated=true; var newLeft=parseInt(list.style.left)+offset; var time=300; var interval=10; var speed=offset/(time/interval); function go(){ if((speed<0 && parseInt(list.style.left)>newLeft)) || ((speed>0 && parseInt(list.style.left)-200){ list.style.left=-600*len+"px"; } if(newLeft<(-600*len)){ list.style.left="-600px"; } animated=false; } } go(); } next.onclick=function () { if(animated) { return; } if (index==12) { index=1; } else{ index+=1; } showButton(); if(animated==false) { animate(-600); } } prev.onclick=function () { if (index==1) { index=12; } else{ index-=1; } showButton(); if(animated==false) { animate(600); } } function showButton(){ for(var i=0;i<buttons.length;i++) i="0;i<buttons.length;i++){" ;="" }="" p="" }<="" container.onmouseout="play;" container.onmouseover="stop;" animated="=false)" index="myindex;" offset="-600*(myindex-index);" var="" myindex="parseInt(this.getAttribute("index"));" this.classname="="on"){" .onclick="function(){" function="" timer="setInterval(function(){" .classname="="on")" if="">="">)){>

正在回答

1 回答

提问的时候建议你注意一下代码格式,这样看起来真的很难受

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

为什么实现不了,求大神指教

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信