<HTML>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<TITLE>无间隙文字向上滚动特效</TITLE>
<style type="text/css">
ul {
padding-right: 0px;
padding-left: 0px;
padding-bottom: 0px;
margin: 0px;
padding-top: 0px
}
#net {
width:100%;
background:url(img/menu_bg.gif) repeat;
overflow: hidden;
}
#net div {
border: #e6e6e6 1px solid;
padding:0px 10px 0px 10px;
overflow-y:hidden;
line-height: 24px;
height: 24px
}
#net li {
font-size: 12px;
float: left;
list-style-type: none;
margin-right: 20px;
padding-left: 10px;
background: url() no-repeat 0px 50%;
white-space: nowrap
}
#net a {
text-decoration: none;
}
#net a:hover {
text-decoration:underline;
}
</style>
</HEAD>
<BODY>
<DIV id=net onMouseOver="if(!anncount) {clearTimeout(annst);annst = 0}" onMouseOut="if(!annst) annst = setTimeout('mainDo()', anndelay);">
<DIV id=w_net>
<UL>
<li><a href="#" target="_blank">滚动新闻1号</a></li>
<li><a href="#" target="_blank">滚动公告2号</a></li>
<li><a href="#" target="_blank">滚动公告3号</a></li>
<li><a href="#" target="_blank">滚动公告4号</a></li>
<li><a href="#" target="_blank">滚动公告5号</a></li>
</UL>
</DIV>
</DIV>
<script type="text/javascript">
function $(id){
return document.getElementById(id);
}
var anndelay = 3000;
var anncount = 0;
var annheight = 24;
var annst = 0;
function mainDo(){
if(!annst){
$('w_net').innerHTML += '<br style="clear: both" />' + $('w_net').innerHTML;
$('w_net').scrollTop = 0;
if($('w_net').scrollHeight > annheight * 3){
annst = setTimeout('mainDo()', anndelay);
}else{
$('net').onmouseover = $('net').onmouseout = null;
}
return;
}
if(anncount == annheight){
if($('w_net').scrollHeight - annheight <= $('w_net').scrollTop){
$('w_net').scrollTop = $('w_net').scrollHeight / 2 - annheight;
}
anncount = 0;
annst = setTimeout('mainDo()', anndelay);
}else{
$('w_net').scrollTop ++ ;
anncount ++ ;
annst = setTimeout('mainDo()', 10);
}
}
mainDo();
</script>
</BODY>
</HTML>