麻辣堂|资源主站|开发论坛|在线手册
首页 Apache Linux Java MySQL 注册帮助 
PHP项目开发组是PHP开发资源网于2007组年建成立的项目开发团队,目前核心开发成员有27人, 项目协作成员8名.下设7个开发组,主要承接大/中型网站项目开发任务。

    由于开发任务较多,人员比较紧张,现面向社会招聘全职或者兼职开发人员,不管你是在校大学生,还是全职开发人员,以及SOHO都可以联系本站,我们可以长期合作,并为您带来丰厚的报酬。
  您现在的位置:PHP开发资源网 > 麻辣堂 > 详细资料
待解决
请教一下在ff中使用setInterval的问题
悬赏分:20 - 2007年08月22日

在ff中使用setInterval和setTimeout方法似乎都存在动画效果不流畅的问题
不知道是否是我的使用方法有问题 隔一段时间ff的效果就会“卡住”一会儿 而ie没有问题

代码如下 请高手指教





test
<script type="text/javascript">

function mList(id){
this._distance = 1;
this._interval = 10;
this._console = null;
this._totalLength = 0;
this._margins = 5;
if(null != id){
this._console = document.getElementById(id);
}
}

mList.prototype.ini = function(id){
this._console = document.getElementById(id);
var children = this._console.childNodes;
for(var i = 0;i < children.length;i ++){
this._totalLength += parseInt(children.clientWidth) + this._margins;
}
}

mList.prototype.goLeft = function(){
this._console.style.left = this._console.offsetLeft - this._distance + "px";
if(this._console.offsetLeft < 0-(parseInt(this._console.firstChild.clientWidth) + this._margins)){
this._console.appendChild(this._console.firstChild);
this._console.style.left = "0px";
}
}

mList.prototype.move = function(objName){
tt = setInterval(objName+".goLeft()", this._interval);
}

var tt = null;
var ll = null;

window.onload = function(){
ll = new mList();
ll.ini("line");
ll.move("ll");
}
</script>





  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7



提问者:熟人   08-22 16:04
答复
路过。。。顺便帮顶:)
回答者:玉米づ冰冻可乐 - 瓦岗村民 8-22 09:10
我也来回答:
不管你有没有帮助我们,瓦岗寨8万村民将感谢你。。。。。

为防止灌水,您需要计算一道数学题: 答案:
25 + 71 = ? 请将计算结果填在上面

 
[]
©2007 PhpRes.COM