代码写到 window.onload里就不滚动,提示 area is not defined,why?为什么呢?
代码写到 window.onload里就不滚动,提示 area is not defined,why?为什么呢? window.onload=function(){ var area=document.getElementById('box'); var timer=500; area.scrollTop=0; setInterval('area.scrollTop++',timer); }