<html>
<head>
<title></title>
</head>
<body>
<div id=mmh style="BACKGROUND: #efefef; OVERFLOW: hidden; WIDTH: 120px; CURSOR: hand; HEIGHT: 100px">
<!--注意设置id:mmh的height的参数-->
<div id=mmh1>
<!--以下为页面显示内容-->
<table>
<tr>
<td>
dffffffffffffffffdffffffffffffff
</td>
</tr>
<tr>
<td>
dffffffffffffffffdffffffffffffff
</td>
</tr>
<tr>
<td>
dffffffffffffffffdffffffffffffff
</td>
</tr>
<tr>
<td>
dffffffffffffffffdffffffffffffff
</td>
</tr>
<tr>
<td>
dffffffffffffffffdffffffffffffff
</td>
</tr>
<tr>
<td>
dffffffffffffffffdffffffffffffff
</td>
</tr>
<tr>
<td>
dffffffffffffffffdffffffffffffff
</td>
</tr>
<tr>
<td>
dffffffffffffffffdffffffffffffff
</td>
</tr>
<tr>
<td>
dffffffffffffffffdffffffffffffff
</td>
</tr>
<tr>
<td>
dffffffffffffffffdffffffffffffff
</td>
</tr>
<tr>
<td>
dffffffffffffffffdffffffffffffff
</td>
</tr>
<tr>
<td>
dffffffffffffffffdffffffffffffff
</td>
</tr>
</table>
</div>
<div id=mmh2>
</div>
</div>
<SCRIPT language="javascript">
var speed=10;
mmh2.innerHTML=mmh1.innerHTML;
//id.innerHTML显示的是ID显示的内容
//alert(mmh2.innerHTML);
function Marquee(){
if(mmh2.offsetHeight-mmh.scrollTop<=0){
mmh.scrollTop-=mmh1.offsetHeight;
//alert(mmh2.offsetWidth);
}
else{
mmh.scrollTop++;
}
}
var Mymmh=setInterval(Marquee,speed);
//alert(Mymmh);
mmh.οnmοuseοver=function()
{clearInterval(Mymmh);}
mmh.οnmοuseοut=function()
{Mymmh=setInterval(Marquee,speed);}
</SCRIPT>
</body>
</html>
用javascript实现的marquee效果
最新推荐文章于 2021-06-01 16:27:17 发布