JS实现无间隔marquee
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<style type="text/css">
* {
vertical-align: baselinebaseline;
font-size:12px;
font-family:"宋体", Verdana, Geneva, sans-serif;
outline:0;
padding:0;
margin:0;
border:0;
}
#text{
float:left;
width:200px;
height:80px;
display:inline;
overflow:hidden;
}
/* 200px宽度布局外框 */
.layout_200 {
width:200px;
margin:10px 0 0 0;
}
/*========================无日期列样式表===============================*/
ul.newlist { width:100%;}
ul.newlist li {
width:90%;
background:url(http://www.js.10086.cn/images/default/icon_list.gif) no-repeat 4px center;
margin:0 auto;
padding:0 0 0 16px;
border-bottom:1px dotted #d4d4d4;
line-height:26px;
}
</style>
</HEAD>
<BODY>
<div class="side_box"><!-- side_box start -->
<div class="layout_200 news" style=""><!-- layout_200 start -->
<h2 class="tit"><b>资讯速递</b></h2>
<div class="sidebar_box"><!-- sidebar_box start -->
<div id="text" style="">
<div id="text1">
<ul class="newlist">
<li><a title="财经:2010国家信用风险报告">财经:2010国家信用风...</a></li>
<li><a title="体育:西班牙首冠创世纪">体育:西班牙首冠创世纪</a></li>
<li><a title="新闻:副处级以上干部须申报财产">新闻:副处级以上干部须申...</a></li>
<li><a title="娱乐:克里斯汀-斯图尔特:越叛逆越性感">娱乐:克里斯汀-斯图尔特...</a></li>
</ul>
</div>
<div id="text2"></div>
</div>
<script type="text/javascript">
var speed=80;
var ZJJtext=document.getElementById('text');
var ZJJtext1=document.getElementById('text1');
var ZJJtext2=document.getElementById('text2');
ZJJtext2.innerHTML=ZJJtext1.innerHTML
function Marquee1(){
if(ZJJtext2.offsetHeight-ZJJtext.scrollTop<=0)
ZJJtext.scrollTop-=ZJJtext1.offsetHeight
else{
ZJJtext.scrollTop++
}
}
var MyMar1=setInterval(Marquee1,speed)
ZJJtext.onmouseover=function() {clearInterval(MyMar1)}
ZJJtext.onmouseout=function() {MyMar1=setInterval(Marquee1,speed)}
</script>
</div><!-- sidebar_box end -->
</div><!-- layout_200 end -->
</BODY>
</HTML>
<HEAD>
<TITLE> New Document </TITLE>
<style type="text/css">
* {
vertical-align: baselinebaseline;
font-size:12px;
font-family:"宋体", Verdana, Geneva, sans-serif;
outline:0;
padding:0;
margin:0;
border:0;
}
#text{
float:left;
width:200px;
height:80px;
display:inline;
overflow:hidden;
}
/* 200px宽度布局外框 */
.layout_200 {
width:200px;
margin:10px 0 0 0;
}
/*========================无日期列样式表===============================*/
ul.newlist { width:100%;}
ul.newlist li {
width:90%;
background:url(http://www.js.10086.cn/images/default/icon_list.gif) no-repeat 4px center;
margin:0 auto;
padding:0 0 0 16px;
border-bottom:1px dotted #d4d4d4;
line-height:26px;
}
</style>
</HEAD>
<BODY>
<div class="side_box"><!-- side_box start -->
<div class="layout_200 news" style=""><!-- layout_200 start -->
<h2 class="tit"><b>资讯速递</b></h2>
<div class="sidebar_box"><!-- sidebar_box start -->
<div id="text" style="">
<div id="text1">
<ul class="newlist">
<li><a title="财经:2010国家信用风险报告">财经:2010国家信用风...</a></li>
<li><a title="体育:西班牙首冠创世纪">体育:西班牙首冠创世纪</a></li>
<li><a title="新闻:副处级以上干部须申报财产">新闻:副处级以上干部须申...</a></li>
<li><a title="娱乐:克里斯汀-斯图尔特:越叛逆越性感">娱乐:克里斯汀-斯图尔特...</a></li>
</ul>
</div>
<div id="text2"></div>
</div>
<script type="text/javascript">
var speed=80;
var ZJJtext=document.getElementById('text');
var ZJJtext1=document.getElementById('text1');
var ZJJtext2=document.getElementById('text2');
ZJJtext2.innerHTML=ZJJtext1.innerHTML
function Marquee1(){
if(ZJJtext2.offsetHeight-ZJJtext.scrollTop<=0)
ZJJtext.scrollTop-=ZJJtext1.offsetHeight
else{
ZJJtext.scrollTop++
}
}
var MyMar1=setInterval(Marquee1,speed)
ZJJtext.onmouseover=function() {clearInterval(MyMar1)}
ZJJtext.onmouseout=function() {MyMar1=setInterval(Marquee1,speed)}
</script>
</div><!-- sidebar_box end -->
</div><!-- layout_200 end -->
</BODY>
</HTML>