function leftMove(obj,pos){ var num = 0; setInterval(function(){ num++; if(num<141){ if(pos==1 && obj.offsetLeft<0){ obj.style.left = obj.offsetLeft + 5 + "px"; } else if(pos==2 && obj.offsetLeft>-700*(picProveLis.length-1)){ obj.style.left = obj.offsetLeft - 5 + "px"; } } },1) } pic_goleft.onclick = function(){ leftMove(picProveUl,1); } pic_goright.onclick = function(){ leftMove(picProveUl,2); }
时间: 2024-10-12 13:37:47