62,040
社区成员
发帖
与我相关
我的任务
分享
<!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">
*{margin:0px; padding:0px; font-size:12px; color:#333; font-family:"新宋体";}
#fla{
width:950px;
margin-top:15px;
margin-bottom:15px;
text-align:center;
}
#fla img{
width:950px;
height:100px;
cursor:pointer;
}
#hot_right{
width:298px;
height:27px;
overflow:hidden;
text-align:left;
text-indent:10px;
color:#990033;
line-height:27px;
border:#ccc 1px solid;
}
</style>
</head>
<body>
<script language="javascript">
function $(id){
return document.getElementById(id);
}
var DocScroll={
picH:27,
scrollstep:3,
scrolltime:20,
stoptime:2000,
tmpH:0,
Mar:null,
stop:false,
init:function(obj){
DocScroll.Mar = $(obj);
DocScroll.Mar.onmouseover = function(){DocScroll.stop = true};
DocScroll.Mar.onmouseout = function(){ DocScroll.stop = false};
DocScroll.child_div=DocScroll.Mar.getElementsByTagName("div");
DocScroll.Mar.innerHTML += DocScroll.Mar.innerHTML;
setTimeout(DocScroll.start,DocScroll.stoptime);
},
start:function(){
if(DocScroll.tmpH < DocScroll.picH){
DocScroll.tmpH += DocScroll.scrollstep;
if(DocScroll.tmpH > DocScroll.picH )DocScroll.tmpH = DocScroll.picH ;
DocScroll.Mar.scrollTop = DocScroll.tmpH;
setTimeout(DocScroll.start,DocScroll.scrolltime);
}else{
DocScroll.tmpH = 0;
DocScroll.Mar.appendChild(DocScroll.child_div[0]);
DocScroll.Mar.scrollTop = 0;
setTimeout(DocScroll.start,DocScroll.stoptime);
}
}
}
</script>
<div align="center">
<br />
<div id="hot_right">
<div>1。这是第一条</div>
<div>2。这是第二条</div>
<div>3。这是第三条</div>
<div>4。这是第四条</div>
<div>5。这是第五条</div>
<div>6。这是第六条</div>
</div>
<script language="javascript">
(function(){
DocScroll.init('hot_right');
}());
</script>
</div>
</body>
</html>