滚动经典最新话题[prototype框架]下编写

2019-06-03 18:43:21丽君

            var author = items[i].childNodes[4].childNodes[0].nodeValue;
            this.m_scroll_1.innerHTML += "<span><a href=""+link+"" title=""+author+":rn"+description+"">"+i+":"+title+"</a></span>";
        }
        this.m_scroll_2.innerHTML = this.m_scroll_1.innerHTML;
    },
    scroll:function(event){
        switch(this.scrollType){
            case "slow":
                if(this.m_scroll_2.offsetWidth-this.m_scroll.scrollLeft<=0){
                    this.m_scroll.scrollLeft -= this.m_scroll_1.offsetWidth;
                }else{
                    this.m_scroll.scrollLeft++;
                }
            break;
            case "normal":
            default:
                if(this.m_scroll_2.offsetWidth-this.m_scroll.scrollLeft<=0){
                    this.m_scroll.scrollLeft -= this.m_scroll_1.offsetWidth;
                }else{
                    this.m_scroll.scrollLeft+=3;
                }
            break;
        }
    },
    mouseover:function(){
        this.scrollType = 'slow';
        return false;
    },
    mouseout:function(){
        this.scrollType = 'normal';
        return false;