<!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">
div{width:400px;height:100px;overflow: hidden;}
ul {
list-style: none; /* 去掉ul标签默认的点样式 */
background:#9F0;
overflow: hidden;
}
div{overflow: hidden;}
</style>
<script type="text/javascript">
window.onload =function(){
myScroll();
}
var area = document.getElementById("box");
var mydiv=document.getElementById("mydiv");
var mydiv2 =document.getElementById("mydiv2");
mydiv2.innerHTML = mydiv.innerHTML;
area.scrollTop=0;
function myScroll(){
if(area.scrollTop>=mydiv.offsetHeight){
area.scrollTop=0;
}else{
area.scrollTop++;
}
}
var gundong = setInterval("myScroll()",50);
area.onmousemove = function(){
clearsetInterval(gundong);
}
area.onmouseout = function(){
gundong = setInterval("myScroll()",50);
}
</script>
</head>
<body>
<div id="box" >
<ul id='mydiv' style="background:#9F0;">
<li><a href="#">1.学会html5 绝对的屌丝逆袭(案例)</a><span>2013-09-18</span></li>
<li><a href="#">2.tab页面切换效果(案例)</a><span>2013-10-09</span></li>
<li><a href="#">3.圆角水晶按钮制作(案例)</a><span>2013-10-21</span></li>
<li><a href="#">4.HTML+CSS基础课程(系列)</a><span>2013-11-01</span></li>
<li><a href="#">5.分页页码制作(案例)</a><span>2013-11-06</span></li>
<li><a href="#">6.导航条菜单的制作(案例)</a><span>2013-11-08</span></li>
<li><a href="#">7.信息列表制作(案例)</a><span>2013-11-15</span></li>
<li><a href="#">8.下拉菜单制作(案例)</a><span>2013-11-22</span></li>
<li><a href="#">9.如何实现“新手引导”效果</a><span>2013-12-06</span></li>
</ul>
<ul id="mydiv2></ul>
</div>
</body>
</html>
Tobey_滔
相关分类