<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>
<script language="javascript">
var l = 5;
function over(w)
{
    
if(w == "l")l = 5;                //如果层向右移
    if(w == "r")l = -5;            //如果层向左移
    window.setInterval("move()",70);//每隔70毫秒重复执行move函数
}

function move()                    //移动层的函数
{
    
var n = document.all.Layer2.style.left;    //取层的当前位置,得到的是一字符串
    n = n.replace(/[^\d|\-]*/gi,"");        //去掉除数字和负号的其它字符
    n = parseInt(n);                //将字符串转化成数字
    document.all.Layer2.style.left = n + l;    //设置层的新位置
    if(l == 0)window.clearInterval();        //如果鼠标已不在移动链接上,让循环停止
}

function stop()
{
    l 
= 0;
}

</script>
<body>
<align="center"><br>
<href="#" onmouseover=over("l"); onmouseout=stop();>&lt;&lt;</a>&nbsp;&nbsp;&nbsp; <href="#" onmouseover=over("r"); onmouseout=stop();>&gt;&gt;</a>
  
<div id="Layer2" style="position:absolute; width:500; height:22; z-index:1; left: 0; top:0">
    
<table width="500" border="0">
      
<tr>
        
<td><href="#">111</a></td>
        
<td><href="#">222</a></td>
        
<td><href="#">333</a></td>
        
<td><href="#">444</a></td>
        
<td><href="#">555</a></td>
        
<td><href="#">666</a></td>
        
<td><href="#">777</a></td>
        
<td><href="#">888</a></td>
        
<td><href="#">999</a></td>
        
<td><href="#">000</a></td>
      
</tr>
    
</table>
  
</div>
</body>
</html>
Posted on 2005-04-29 15:45  古代  阅读(594)  评论(0)    收藏  举报