1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 [Ctrl A select all 참고: 외부 J를 도입해야 하는 경우 실행하려면 새로 고쳐야 합니다 ] marque(320,196,"icefable1","box1left") var scrollElem; var stopscroll; var stoptime; var preTop; var leftElem; var currentTop; var marqueesHeight; function marque(width,height,marqueName,marqueCName){ try{ marqueesHeight = height; stopscroll = false; <P> scrollElem = document.getElementById("adsfar"); with(scrollElem){ style.width = width; style.height = marqueesHeight; style.overflow = 'hidden'; noWrap = true; } <P> scrollElem.onmouseover = new Function('stopscroll = true'); scrollElem.onmouseout = new Function('stopscroll = false'); <P> preTop = 0; currentTop = 0; stoptime = 0; <P> leftElem = document.getElementById("adsfar"); scrollElem.appendChild(leftElem.cloneNode(true)); init_srolltext(); <P> }catch(e) {} } function init_srolltext(){ scrollElem.scrollTop = 0; setInterval('scrollUp()', 18); } <P>function scrollUp(){ if(stopscroll) return; currentTop += 1; if(currentTop == marqueesHeight+1) { stoptime += 1; currentTop -= 1; if(stoptime == (marqueesHeight)*1) {//停顿时间 currentTop = 0; stoptime = 0; } }else{ <P> preTop = scrollElem.scrollTop; scrollElem.scrollTop += 1; if(preTop == scrollElem.scrollTop){ scrollElem.scrollTop = marqueesHeight; scrollElem.scrollTop += 1; } } }