代码如下:
<!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>
<base target="_blank">
<style>
*{margin:0;padding:0;border:0;list-style:none;}
body{font:12px Verdana, Geneva, sans-serif;line-height:18px;color:#333;}
a{text-decoration:none;color:#004285;font-size:14px;font-weight:bold;}
a:hover{text-decoration:underline;color:#C33;}
.rig{border:1px solid #dedede;width:282px;margin-bottom:5px;position:relative;background:#fff;}
#qy a{font-size:12px;}
h5 span a{font-size:12px;font-weight:normal;color:#333;}
h5{padding:0 10px;font-size:14px;height:30px;line-height:30px;background:url(http://pigimg.zhongso.com/space/gallery/工程起重机/971669-1.jpg?1259835263) left center repeat-x;border-bottom:1px solid #dedede;}
span{float:right;}
</style>
</head>
<body>
<div class="rig">
<h5><span><a href="http://www.gcqzj.com/channel/13083962">更多>></a></span>精彩企业专题</h5>
<div id="qy" style="width:256px;margin:7px 10px 5px;height:94px;overflow:hidden" onMouseOver="qiScrollAmount=0"
onmouseout="qiScrollAmount=2">
<ul>
<li id="tab1">
<table border='0' cellspacing='0' cellpadding='0' width='256px'>
<tr>
<td height='70'><a href="http://www.gcqzj.com/channel/13335574"><img src="http://pigimg.zhongso.com/space/gallery/infoimgs/gc/gcqzj/20100520/2010052017415793313.jpg" /></a></td>
</tr>
<tr>
<td height='24'><span><a href="http://www.gcqzj.com/channel/13335574">进入专题</a></span>
<p><a href="http://www.gcqzj.com/channel/13335574">广州市巨和机械专题</a></p></td>
</tr>
<!--一行-->
<tr>
<td height='70'><a href="http://www.gcqzj.com/channel/13295702"><img src="http://pigimg.zhongso.com/space/gallery/infoimgs/gc/gcqZj/20100415/2010041515380563250.jpg" /></a></td>
</tr>
<tr>
<td height='24'><span><a href="http://www.gcqzj.com/channel/13295702">进入专题</a></span>
<p><a href="http://www.gcqzj.com/channel/13295702">徐工集团专题</a></p></td>
</tr>
<!--一行-->
<tr>
<td height='70'><a href="http://www.gcqzj.com/channel/13035462"><img src="http://pigimg.zhongso.com/space/gallery/工程起重机/971677-1.jpg?1259836876" /></a></td>
</tr>
<tr>
<td height='24'><span><a href="http://www.gcqzj.com/channel/13035462">进入专题</a></span>
<p><a href="http://www.gcqzj.com/channel/13035462">三一重工专题</a></p></td>
</tr>
</table>
</li>
<li id="tab2"></li>
</ul>
</div>
<style>
#btm{position:absolute;right:0;top:60px;width:12px;height:43px;background:url(http://pigimg.zhongso.com/space/gallery/infoimgs/gc/gcqZj/20100417/2010041716281352947.gif) no-repeat;overflow:hidden;}
#btm a{display:block;height:22px;}
#btm a#up:hover{background:url(http://pigimg.zhongso.com/space/gallery/infoimgs/gc/gcqZj/20100417/2010041716281352947.gif) -13px top no-repeat;}
#btm a#dw:hover{background:url(http://pigimg.zhongso.com/space/gallery/infoimgs/gc/gcqZj/20100417/2010041716281352947.gif) -26px -22px no-repeat;}
</style>
<div id="btm"><a id="up" onclick="up()" href="javascript:;" target="_self"></a><a id="dw" onclick="dw()" href="javascript:;" target="_self"></a></div>
<script>
var qoMarquee = document.getElementById("qy"); //滚动对象
var tab1 = document.getElementById("tab1");
var tab2 = document.getElementById("tab2");
var qiLineHeight = 94;//单行高度,像素IE
var qiLineCount = 0; //实际行数
var qiScrollAmount = 2; //每次滚动高度,像素(速度)
var speed1=3000;//每次停留时间
var speed2=1;//滚动速度
var num=qoMarquee.getElementsByTagName('img').length;//总数
tab2.innerHTML=tab1.innerHTML;
var alink=document.getElementById('btm').getElementsByTagName('a');
for(var i=0;i<alink.length;i++){
alink[i].onfocus=function(){this.blur();}
}
function run() {
if(qoMarquee.scrollTop==num*qiLineHeight){qoMarquee.scrollTop=0;window.setTimeout( "run()", speed2 );}//重置并接着滚动
else{
qoMarquee.scrollTop +=qiScrollAmount;
if ( qoMarquee.scrollTop % qiLineHeight == 0 ) {window.setTimeout( "run()", speed1 );}//如果满格等待N秒
else {window.setTimeout( "run()", speed2 );}//正常滚动
}
}
function up(){
qiScrollAmount = 0;
var amount=1;
if(qoMarquee.scrollTop==num*qiLineHeight) qoMarquee.scrollTop=0;
qoMarquee.scrollTop +=amount;
if ( qoMarquee.scrollTop % qiLineHeight == 0 ) {amount=0;window.setTimeout( "qiScrollAmount = 2", speed1 );}
else window.setTimeout( up(), 1 );
}
function dw(){
qiScrollAmount = 0;
var amount=1;
if(qoMarquee.scrollTop==0) qoMarquee.scrollTop=num*qiLineHeight;
qoMarquee.scrollTop -=amount;
if ( qoMarquee.scrollTop % qiLineHeight == 0 ) {amount=0;window.setTimeout( "qiScrollAmount = 2", speed1 );}
else window.setTimeout( dw(), 1 );
}
window.setTimeout( "run()", speed1 );
</script>
</div>
</body>
</html>