日期:2014-05-17  浏览次数:20583 次

急急急急急!!!!各位大哥大姐。
<script type="text/javascript">

    //<![CDATA[

    <!--

    function scrollerObj(name,initH,initW,heightB,widthB,content,initBg,Bg,speed,initFl){

    //**data**//

    this.name=name;

    this.initH=initH;

    this.initW=initW;

    this.heightB=heightB;

    this.widthB=widthB;

    this.content=content;

    this.initBg=initBg;

    this.Bg=Bg;

    this.iniFl=initFl;

    this.speed=parseInt(speed);

    this.timer = name + "Timer";

    this.elem;





    //**methods**//

    this.getElement = getElement;

    this.createLayer=createLayer;

    this.scrollLayer = scrollLayer; 

    this.scrollLoop=scrollLoop;



    //**initiate methods**//

    this.createLayer();

    this.getElement();

    this.scrollLayer();

    }



    //**call this method to stop scrolling**//

    function scrollLoop(s){

    this.speed = s;

    }



    //**pretty obvious**//

    function scrollLayer(){

    if(parseInt(this.elem.style.top)>(this.elem.offsetHeight*(-1))){

        this.elem.style.top = parseInt(this.elem.style.top)-this.speed;

        //alert(parseInt(this.elem.style.top)+"\n"+this.elem.id);

    }

    else {this.elem.style.top = this.initH;}

    }



    //**get the specific dom-expression**//

    function getElement(){

    if(document.getElementById){

        this.elem = document.getElementById(this.name);

        }