为什么加了window.onload后放在<head>里还是提示错误????
为什么加了window.onload后放在<head>里还是提示错误????
srollTop一定要放在<body>里吗??
window.onload=function () { var area = document.getElementById('newsBox'); var con1 = document.getElementById('con1'); var con2 = document.getElementById('con2'); var speed = 50; con2.innerHTML = con1.innerHTML; var myScroll = setInterval("scrollUp()", speed); function scrollUp() { if (area.scrollTop >= con1.scrollHeight) { area.scrollTop = 0; } else { area.scrollTop++; } } }