我就想知道怎么把这个脚本放到js文件里面
window.onload也不行
window.onload也不行
2015-06-17
window.onload = function () { var area = document.getElementById('moocbox'); var con1 = document.getElementById('con1'); var con2 = document.getElementById('con2'); con2.innerHTML = con1.innerHTML; function scrollUp(){ if(area.scrollTop >= con1.offsetHeight){ area.scrollTop=0; }else{ area.scrollTop++; } } var time = 50; var myScroll = setInterval('scrollUp()',time); area.onmouseover = function(){ clearInterval(myScroll); } area.onmouseout = function(){ myScroll = setInterval('scrollUp()',time); } }
举报