解决方案 »

  1.   

    this.obj.onmouseover = function(){
    clearInterval(This.t);
    }
    this.obj.onmouseout = function(){
    This.t;
    }移上去可以停止动画,移开不能继续
      

  2.   

    clearInterval(This.t);不是清理了吗?
      

  3.   

    clearInterval(This.t);不是清理了吗?鼠标移上去的时候清除了定时器,所以动画不会继续,但是鼠标移开后并没有执行什么操作啊..
      

  4.   

    function rolling(obj,obj1){
    this.Roll = document.getElementById(obj); //滚动的大层;
    this.li = this.Roll.getElementsByTagName('li');//每个图片层
    this.width = this.li[0].offsetWidth; //获取每个图片层的宽度
    this.len = this.li.length;    //长度
    this.Roll.style.width = this.width * this.len +'px';
    this.inow = 0;
    this.obj = document.getElementById(obj1);
    }rolling.prototype.setIn = function(obj){
    var This = this;
    This.start = function(){
    this.t = setInterval(function(){
    This.inow ++;
    This.inow >= This.Roll.offsetWidth - This.obj.offsetWidth?This.inow = 0: This.inow;
    This.Roll.style.left = -This.inow +'px';
    },30)
    }
    this.obj.onmouseover = function(){
    clearInterval(This.t);
    }
    this.obj.onmouseout = function(){
    This.start()
    }
    }
    试试这样..