<div id="demoh" style="OVERFLOW: hidden; WIDTH: 174px; HEIGHT: 100px; ">
<table cellspacing=0 cellpadding=0 border=0>
<tbody>
<tr>
<td id="demoh1"><table width="170" border="0" align="center" cellpadding="2" cellspacing="1">
<tr>
<td><img src="moban/web/images/new_bottom_2.gif" width="5" height="5" /> <A
href="directory/company6.html" title="温州星雨">温州星雨</A> </td>
</tr>
<tr>
<td><img src="moban/web/images/new_bottom_2.gif" width="5" height="5" /> <A
href="directory/company5.html" title="新兴测试公司">新兴测试公司</A> </td>
</tr>
<tr>
<td><img src="moban/web/images/new_bottom_2.gif" width="5" height="5" /> <A
href="directory/company4.html" title="时代广场">时代广场</A> </td>
</tr>
<tr>
<td><img src="moban/web/images/new_bottom_2.gif" width="5" height="5" /> <A
href="showroom/duoduoduo" title="温州市天普网络科技有限公司天普网络科技">温州市天普网络科技有...</A> </td>
</tr>
<tr>
<td><img src="moban/web/images/new_bottom_2.gif" width="5" height="5" /> <A
href="showroom/abcde" title="时代广场">时代广场</A> </td>
</tr>
<tr>
<td><img src="moban/web/images/new_bottom_2.gif" width="5" height="5" /> <A
href="showroom/admin" title="天普网络">天普网络</A> </td>
</tr>
</table></td>
</tr>
<tr>
<td id="demoh2"></td>
</tr>
</tbody>
</table>
</div>
<SCRIPT>
var speed=50
//原理是不断的向demoh2中填入demoh1中的内容,然后将已经看不见的清除
//用一个两行一列的表格,上一列再放一个装填有内容的表格,定义为demoh1,下一列是空的TD,定义为demoh2
//SPEED是用来控制速度的。
//横向同理
function Marqueeh(){
if(demoh2.offsetHeight-demoh.scrollTop<=0)
demoh.scrollTop-=demoh1.offsetHeight
else{
demoh.scrollTop++
}
}
demoh2.innerHTML=demoh1.innerHTML
var MyMarh=setInterval(Marqueeh,speed)
demoh.οnmοuseοver=function(){ clearInterval(MyMarh) }
demoh.οnmοuseοut=function(){ MyMarh=setInterval(Marqueeh,speed) }
</SCRIPT>
另一种纵向滚动
====================
<div style="width:170px;height:90;overflow:hidden" onMouseOver="mpstop(1)" onMouseout="mpstop(0)">
<table cellspacing=0 border="0" align="center" cellpadding=0 bgcolor="#f1f8fa" style="position:relative;top:0px;width:200px;table-layout:fixed" id=mptj>
<tbody>
<tr>
<td valign=top height=150><TABLE width="95%" align="center" cellspacing=0 cellpadding=0 border="0">
<tr height="0">
<td style='cursor:hand'> <font color="#FF0000">- 新闻标题1</font><br>
<font color="#FF0000">- 新闻标题2</font><br>
<font color="#FF0000">- 新闻标题3</font><br>
<font color="#FF0000">- 新闻标题4</font><br>
<font color="#FF0000">- 新闻标题5</font><br>
<font color="#FF0000">- 新闻标题6</font><br>
<font color="#FF0000">- 新闻标题7</font><br>
</td>
</tr>
</TABLE></td>
</tr>
</tbody>
<script language=javascript>
//重复一次新闻内容
document.write(mptj.tBodies[0].innerHTML)
</script>
</table>
</div>
<script language=javascript>
var mpmove = 1;
//实现不间断滚动
function mptjScroll()
{
mptj.style.pixelTop=(mptj.style.pixelTop-mpmove)%(mptj.clientHeight/2);
}
timer1=setInterval('mptjScroll()',30) //更改第二个参数可以改变速度,值越小,速度越快。
function mpstop(flag)
{
if(flag == 1)
mpmove=0;
else
mpmove=1;
}
</script>