js面向的基础问题 面向对象 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 this.obj.onmouseover = function(){clearInterval(This.t);}this.obj.onmouseout = function(){This.t;}移上去可以停止动画,移开不能继续 clearInterval(This.t);不是清理了吗? clearInterval(This.t);不是清理了吗?鼠标移上去的时候清除了定时器,所以动画不会继续,但是鼠标移开后并没有执行什么操作啊.. 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() }}试试这样.. 关于Ext.FormPanel随着Window隐藏后不会更新的问题 跪求 如何访问远程服务器 復選框全選觸發事件的問題 淘宝网搜索网址栏内对字符的编码问题 有100分赠送,时间差的计算问题 请大家看看这个电子地图的放大缩小怎么实现的,ajax 关于bt1.btchina.net网页加密的问题,老鸟请进!Up没分! radio点击以下选中,在点击恢复未选状态,怎么弄? 大家来帮我看看哪里出了错 javascipt要日期加7怎么做 使用manager confirm 刷新页面 大早上遇到个问题 js 闭包,大家给看一下
clearInterval(This.t);
}
this.obj.onmouseout = function(){
This.t;
}移上去可以停止动画,移开不能继续
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()
}
}
试试这样..