有时间的话看一下下面的代码就明白啦!!!!
你可以在<span>里设置事件。不过不加链接就没有小手了。
但是你可以给它用一个样式。也就是如同下面“style1”的样式,就会同样的有一只小手了。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
.style1{
font-size:12px;
line-height:20px;
cursor: hand;
}
-->
</style>
<script language="javascript" type="text/javascript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"
)>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible'
v=='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</script>
</head>
<body leftmargin="0" topmargin="0">
<table width="49%" border="0" cellpadding="0" cellspacing="10">
<tr>
<td height="13" align="left" valign="top" bgcolor="#CCCCCC">
<span class="style1" onClick="MM_showHideLayers('Layer1','','show')">打开隐藏层</span> </td>
</tr>
</table>
<table width="49%" border="0" cellpadding="0" cellspacing="10">
<tr>
<td height="13" align="left" valign="top" bgcolor="#CCCCCC"> <span class="style1" onClick="MM_showHideLayers('Layer1','','hide')">关闭隐藏层</span>
<div id="Layer1" style="position:absolute; width:200px; height:115px; z-index:1; left: 12px; top: 91px; visibility: hidden;">隐藏层显示</div></td>
</tr>
</table>
</body>
</html>