﻿                marqueesWidth=910; //控制滚动宽度
                with(marquees){
                    style.height=20;
                    style.width=marqueesWidth;
                    style.overflowX="hidden";
                    style.overflowY="visible";
                    noWrap=true;
                    onmouseover=new Function("stopscroll=true");
                    onmouseout=new Function("stopscroll=false");
                }
                    preLeft=0; currentLeft=0; stopscroll=false;

                function init(){
                    templayer.innerHTML="";
                    while(templayer.offsetWidth<marqueesWidth){
                    templayer.innerHTML+=marquees.innerHTML;
                }
                    marquees.innerHTML+=templayer.innerHTML;
                    setInterval("scrollLeft()",30); //这里控制速度
                }init();

                function scrollLeft(){
                if(stopscroll==true) return;
                        preLeft=marquees.scrollLeft;
                        marquees.scrollLeft+=1;
                    if(preLeft==marquees.scrollLeft){
                        marquees.scrollLeft=templayer.offsetWidth-marqueesWidth+1;
                    }
                }