RT,有段文字走马灯的代码在FF中不能跑,求帮忙改下,谢谢了!附上代码
window.onload=function(){
var o=document.getElementById('marquee');
window.setInterval(function(){scrollup(o,20,0);},2000);
}function scrollup(o,d,c){
if(d==c){
var t=o.firstChild.cloneNode(true);
o.removeChild(o.firstChild);
o.appendChild(t);
t.style.marginTop=o.firstChild.style.marginTop='0px';
}
else{
var s=3,c=c+s,l=(c>=d?c-d:0);
o.firstChild.style.marginTop=-c+l+'px';
window.setTimeout(function(){scrollup(o,d,c-l)},100);
}
}
在线等,谢谢
window.onload=function(){
var o=document.getElementById('marquee');
window.setInterval(function(){scrollup(o,20,0);},2000);
}function scrollup(o,d,c){
if(d==c){
var t=o.firstChild.cloneNode(true);
o.removeChild(o.firstChild);
o.appendChild(t);
t.style.marginTop=o.firstChild.style.marginTop='0px';
}
else{
var s=3,c=c+s,l=(c>=d?c-d:0);
o.firstChild.style.marginTop=-c+l+'px';
window.setTimeout(function(){scrollup(o,d,c-l)},100);
}
}
在线等,谢谢
<div id="marquee">
<!-- <ul id="data"></ul>
<marquee id="a" onmousemove="a.stop()" onmouseout="a.start()" >
<div align="center">1111111111111111111111111111111111</div>
</marquee> -->
<div><a href="#">文明游戏,礼貌待人!</a></div>
<div>合理安排时间,按时收菜</div>
<div>记得训练英雄,日常</div>
<div>被人欺负了可以充金币,也可以喊人- -!</div> </div>
var o=document.getElementById('marquee');
window.setInterval(function(){scrollup(o,20,0);},2000);
} function scrollup(o,d,c){
var hi = o.firstElementChild || o.firstChild;
if(d==c){
var t=hi.cloneNode(true);
o.removeChild(hi);
o.appendChild(t);
t.style.marginTop=hi.style.marginTop='0px';
}
else{
var s=3,c=c+s,l=(c>=d?c-d:0);
hi.style.marginTop=-c+l+'px';
window.setTimeout(function(){scrollup(o,d,c-l)},100);
}
}
for(var i=0;i<=1000000;i++)
{
alert("我错了,对不起姐姐- -!!!");
}
]
看
http://dotnet.aspx.cc/file/firstElementChild-lastElementChild-previousElementSibling-nextElementSibling-childElementCount.aspx