嗨呀,这是怎么了??兄弟们帮解决一下,谢谢了
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
*{
margin: 0;padding: 0;
}
#div1{
width: 300px;
height: 100px;
position: relative;
top: 100px;
left: 300px;
border: 5px solid lime;
overflow: hidden;
text-align: center;
}
</style>
</head>
<script>
window.onload=function(){
/* //这样写没反应,就连ul里边的值都不显示了
var area=document.getElementById('div1');
var inner1=document.getElementById('inner1');
var inner2=document.getElementById('inner2');
inner1.innerHTML=inner2.innerHTML;
function scrollUp(){
if(area.scrollTop>=inner1.offsetHeight){
area.scrollTop=0;
}else{
area.scrollTop++;
}
}
var myScroll=setInterval(scrollUp,30);*/
/* //这样写会有反应
var area=document.getElementById('div1');
area.scrollTop=20;*/
}
</script>
<body>
<div id="div1">
<ul id="inner1">
<li>111111111111</li>
<li>2222222222</li>
<li>3333333333</li>
<li>4444444444</li>
<li>5555555555</li>
<li>6666666666</li>
<li>7777777777</li>
<li>8888888888</li>
</ul>
<ul id="inner2"></ul>
</div>
</body>
</html>