为什么这样可以实现字幕滚动效果呢
<!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>无标题文档</title>
<style type="text/css">
#d{position:absolute;background-color:#eee;left:100px;top:100px;}
#d div{font-size:25px;magin:5px;}
</style>
<script type="text/javascript">
function body_onload(){
var handle=setInterval(myfun,500);
var d=document.getElementById("d");
function myfun(){
d.appendChild(d.firstChild);
}
}
</script>
</head>
<body onload="body_onload()">
<div id="d">
<div>我是字幕1</div>
<div>我是字幕2</div>
<div>我是字幕3</div>
<div>我是字幕4</div>
</div>
</body>
</html>