[removed] var $ = function(id){return document.getElementById(id)}; var wrap = $("wrap"); var a = $("a"); var b = $("b"); var show = $("show"); var d; b[removed] = a[removed]; function scrolls(){ d = "n"; if(b.offsetWidth - wrap.scrollLeft <=0){ wrap.scrollLeft = wrap.scrollLeft - b.offsetWidth; } else{ wrap.scrollLeft++; } } t = setInterval("scrolls()",30) function backScrolls(){ if(wrap.scrollLeft <=0){ wrap.scrollLeft = wrap.scrollLeft + b.offsetWidth; } else{ wrap.scrollLeft--; } } function left(){ d = "n"; clearT(); t = setInterval("scrolls()",30); } function right(){ d = "m"; clearT(); t = setInterval("backScrolls()",30); } function clearT(){ clearInterval(t); } function runs(){ if(d == "n"){ left(); } else{ right(); } } wrap. (){ clearT(); } wrap. runs(); } [removed]
...展开收缩