Posted on 2011-04-20 15:33
追梦人 阅读(2582)
评论(0) 编辑 收藏 所属分类:
Javascript
<html>
<body>
<script type="text/javascript">
function showDiv(myobj)
{
if(linkDiv.style.visibility=='visible'){
linkDiv.style.visibility='hidden';
}else{
linkDiv.style.visibility='visible';
document.getElementById("linkDiv").style.left=myobj.offsetLeft+"px";
document.getElementById("linkDiv").style.top=myobj.offsetTop+myobj.offsetHeight+"px";
document.getElementById("linkDiv").style.position="absolute";
}
}
</script>
<center>
<input type="button" id="sssss" onclick="showDiv(this)" value='操作'/>
</center>
<div id="linkDiv" style="border: 1px solid green; width:80;visibility: hidden" onmouseout="hidden(event,this)" >
<input id="cid" type="hidden"/>
<div>
<a style="width: 60px;" href="#"><span>option1</span></a>
</div>
</div>
</body>
</html>