2-2 scrolltop值的問題
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標(biāo)題文檔</title>
<style type="text/css">
*{
margin:0;
padding:0;
?}
.box{
width:300px;
height:250px;
border:#999 solid 3px;
overflow:hidden;
}
#music{
overflow:hidden;
}
#hang{
width:100%;
height:76px;
background:#C00;
text-align:center;
color:#FF0;
font-family:'微軟雅黑';
font-size:42px;
overflow:hidden;
}
ul{
list-style:none;
}
ul li {
line-height:25px;
color:#000;
text-align:center;
text-decoration:none;
}
ul li a{
color:#000;
text-decoration:none;
}
</style>
<script type="text/javascript">
window.onload=function()
{
var music=document.getElementById('music');
var con1=document.getElementById('con');
var timer=null;
function scrollUp()
{
music.scrollTop++;
}
?
setInterval('scrollUp()',300);
}
</script>
</head>
<body>
<div class="box">
<div id="hang">Music
? ? </div>
? ? <div id="music">
? ? <ul id="con">
? ? <li><a href="#">然后怎樣</a></li>
? ? ? ? <li><a href="#"> --Eason Chen</a></li>
? ? ? ? <li><a href="#">完成了所謂的理想</a></li>
? ? ? ? <li><a href="#">放縱了情緒的泛濫</a></li>
? ? ? ? <li><a href="#">汗都流干 天都微亮</a></li>
? ? ? ? <li><a href="#">然后怎樣</a> </li>
? ? ? ? <li><a href="#">擁有了旅行的空檔</a></li>
? ? ? ? <li><a href="#">卻遺失流浪的背囊</a></li>
? ? ? ? <li><a href="#">沿著軌道 一直流浪</a></li>
? ? ? ? <li><a href="#"> 然后怎樣</a></li>
? ? ? ? </ul>
? ? </div>
</div>
</body>
</html>
---------------------------------------
我的代碼,為什么music.scrolltop的值改不了呢?好煩人
2016-05-16
起碼要給music設(shè)置個高度啊?。。。?/p>