87,907
社区成员
发帖
与我相关
我的任务
分享
<style type="text/css">
.f{
cursor:pointer;
position:absolute;
width:357px;
height:194px;
padding:15px 0 0 50px;
background-image:url(http://static5.photo.sina.com.cn/middle/4ef69b3dg5785994300a4&000.jpg)
}
</style>
<script>
var oo = true
function create(){
if(oo==true){
oo=false
var div =document.createElement("div")
div.className="f"
div.id="div"
div.innerHTML="<a href='#'>大法师</a><br>山丘之王<br>血法师<br>怕拉丁"
document.body.appendChild(div)
document.getElementById("div").style.left=document.getElementById("text").offsetLeft+30
document.getElementById("div").style.top=document.getElementById("text").offsetTop
div.onmouseout=del
}}
function del(e){
e=e||event;
var obj=e.relatedTarget||e.toElement;
var div =document.getElementById("div")
if(div.contains(obj))return;
document.body.removeChild(div)
oo=true
}
</script>
<span id="text" onmouseover="create()" style="cursor:pointer;" onMouseOut="del()" >人族</span>